{"action":"created","issue":{"url":"https://api.github.com/repos/winebarrel/piculet/issues/11","labels_url":"https://api.github.com/repos/winebarrel/piculet/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/winebarrel/piculet/issues/11/comments","events_url":"https://api.github.com/repos/winebarrel/piculet/issues/11/events","html_url":"https://github.com/winebarrel/piculet/issues/11","id":60531184,"number":11,"title":"Enhancement request-- revoke, and delete","user":{"login":"emoby","id":9140408,"avatar_url":"https://avatars.githubusercontent.com/u/9140408?v=3","gravatar_id":"","url":"https://api.github.com/users/emoby","html_url":"https://github.com/emoby","followers_url":"https://api.github.com/users/emoby/followers","following_url":"https://api.github.com/users/emoby/following{/other_user}","gists_url":"https://api.github.com/users/emoby/gists{/gist_id}","starred_url":"https://api.github.com/users/emoby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emoby/subscriptions","organizations_url":"https://api.github.com/users/emoby/orgs","repos_url":"https://api.github.com/users/emoby/repos","events_url":"https://api.github.com/users/emoby/events{/privacy}","received_events_url":"https://api.github.com/users/emoby/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-10T16:50:00Z","updated_at":"2015-05-31T06:07:26Z","closed_at":null,"body":"I'm an Ops Engineer in the US.  I've started to use your piculet ruby gem, and absolutely love it-- I don't know how I managed before it, THANKS for writing it!\r\n\r\nI wanted to contribute back to the project a suggestion and code for your review and consideration.\r\n\r\nUSE CASE ONE:  We update security group IP's often, based on certain business requirements, and I found that when we need to authorize new IP's, before we revoke, we run out of rules to assign the new IP's.  I've made a single change to revoke the rules first, and authorize second.  I understand that it's not always optimal to revoke first, but I thought it might be helpful to the community to have an option to revoke first; \"--revoke-first\". (For our business use-case, we need to revoke first, so I've included the code changes that I put in place... obviously just changing order in your \"update\" method)\r\n\r\n### ~/.rvm/gems/ruby-2.0.0-p481/gems/piculet-0.2.6/lib/piculet/wrapper/permission.rb\r\n            def update(dsl)\r\n              log(:info, 'Update Permission', :green, log_id)\r\n              plus_ip_ranges, minus_ip_ranges, plus_groups, minus_groups = diff(dsl)\r\n              unless (minus_ip_ranges + minus_groups).empty?\r\n                @collection.revoke(protocol, port_range, (minus_ip_ranges + minus_groups), :log_color => :green)\r\n              end\r\n              unless (plus_ip_ranges + plus_groups).empty?\r\n                @collection.authorize(protocol, port_range, (plus_ip_ranges + plus_groups), :log_color => :green)\r\n              end\r\n            end\r\n\r\nUSE CASE TWO: When a security group is deleted, most often it's attached to an object within AWS, and it can't be deleted, in which piculet stops processing the rest of the input file.  I've written a rescue block for piclulet to pass the error (as piculet currently does), and then it continues to run -- allowing the script to continue processing the rules following the error. \r\n\r\n## ~/.rvm/gems/ruby-2.0.0-p481/gems/piculet-0.2.6/lib/piculet/wrapper/security-group.rb\r\n        def delete\r\n          log(:info, 'Delete SecurityGroup', :red, \"#{vpc_id || :classic} > #{name}\")\r\n          if name == 'default'\r\n            log(:warn, 'SecurityGroup `default` is reserved', :yellow)\r\n          else\r\n            unless @options.dry_run\r\n              begin\r\n                @security_group.delete\r\n                @options.updated = true\r\n              rescue Exception => e\r\n                log(:info, 'FAILED', :red, e)\r\n              end\r\n            end\r\n          end\r\n        end\r\n\r\nThanks again for your work with the project.​\r\nEric "},"comment":{"url":"https://api.github.com/repos/winebarrel/piculet/issues/comments/107131772","html_url":"https://github.com/winebarrel/piculet/issues/11#issuecomment-107131772","issue_url":"https://api.github.com/repos/winebarrel/piculet/issues/11","id":107131772,"user":{"login":"winebarrel","id":117768,"avatar_url":"https://avatars.githubusercontent.com/u/117768?v=3","gravatar_id":"","url":"https://api.github.com/users/winebarrel","html_url":"https://github.com/winebarrel","followers_url":"https://api.github.com/users/winebarrel/followers","following_url":"https://api.github.com/users/winebarrel/following{/other_user}","gists_url":"https://api.github.com/users/winebarrel/gists{/gist_id}","starred_url":"https://api.github.com/users/winebarrel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winebarrel/subscriptions","organizations_url":"https://api.github.com/users/winebarrel/orgs","repos_url":"https://api.github.com/users/winebarrel/repos","events_url":"https://api.github.com/users/winebarrel/events{/privacy}","received_events_url":"https://api.github.com/users/winebarrel/received_events","type":"User","site_admin":false},"created_at":"2015-05-31T06:07:26Z","updated_at":"2015-05-31T06:07:26Z","body":"I'm sorry that an fix is late.\r\n[v0.2.8.beta4](https://rubygems.org/gems/piculet/versions/0.2.8.beta4) has been released.\r\nThis release includes #13.\r\n"}}