Skip to content

Commit

Permalink
Bug #3846: Already existing rules in security group driver
Browse files Browse the repository at this point in the history
  • Loading branch information
goberle committed Jun 24, 2015
1 parent ce82a2d commit 76ad123
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/vnm_mad/remotes/lib/sg_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ def activate
# Global Bootstrap
SGIPTables.global_bootstrap

attach_nic_id = @vm['TEMPLATE/NIC[ATTACH="YES"]/NIC_ID']

# Process the rules
@vm.nics.each do |nic|
next if attach_nic_id && attach_nic_id != nic[:nic_id]
next if nic[:security_groups].nil?

SGIPTables.nic_pre(@vm, nic)
Expand Down Expand Up @@ -95,9 +98,7 @@ def deactivate
attach_nic_id = @vm['TEMPLATE/NIC[ATTACH="YES"]/NIC_ID']

@vm.nics.each do |nic|
if attach_nic_id && attach_nic_id != nic[:nic_id]
next
end
next if attach_nic_id && attach_nic_id != nic[:nic_id]

SGIPTables.nic_deactivate(@vm, nic)
end
Expand Down

0 comments on commit 76ad123

Please sign in to comment.