Class: Fog::Bouncer::GroupManager
- Inherits:
-
Object
- Object
- Fog::Bouncer::GroupManager
- Defined in:
- lib/fog/bouncer/group_manager.rb
Class Method Summary collapse
Instance Method Summary collapse
- #clear ⇒ Object
-
#initialize(security) ⇒ GroupManager
constructor
A new instance of GroupManager.
- #log(data, &block) ⇒ Object
- #synchronize ⇒ Object
Constructor Details
#initialize(security) ⇒ GroupManager
Returns a new instance of GroupManager.
12 13 14 |
# File 'lib/fog/bouncer/group_manager.rb', line 12 def initialize(security) @security = security end |
Class Method Details
Instance Method Details
#clear ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fog/bouncer/group_manager.rb', line 24 def clear @security.groups.each do |group| log clear: true, revoke: true, group_name: group.name group.revoke end @security.groups.each do |group| log clear: true, destroy: true, group_name: group.name begin group.destroy rescue Fog::Compute::AWS::Error => exception unless exception. =~ /InUse/ raise end log group_in_use: true, group_name: group.name end end end |
#log(data, &block) ⇒ Object
8 9 10 |
# File 'lib/fog/bouncer/group_manager.rb', line 8 def log(data, &block) self.class.log(data, &block) end |
#synchronize ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/fog/bouncer/group_manager.rb', line 16 def synchronize log(synchronize: true) do create_missing_remote_groups synchronize_rules remove_extra_remote_groups end end |