From 4d3f6b2e474a72415346d40a1fa389e915a178f1 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Wed, 26 Oct 2016 19:49:25 +0200 Subject: [PATCH] regex match from the beginning to the end of the string in nic_deactivate --- src/vnm_mad/remotes/lib/security_groups_iptables.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vnm_mad/remotes/lib/security_groups_iptables.rb b/src/vnm_mad/remotes/lib/security_groups_iptables.rb index 558b80e559..2c998f9766 100644 --- a/src/vnm_mad/remotes/lib/security_groups_iptables.rb +++ b/src/vnm_mad/remotes/lib/security_groups_iptables.rb @@ -328,7 +328,7 @@ module SGIPTables remove_chains = [] iptables_s.lines.each do |line| - if line.match(/^-N #{chain}/) + if line.match(/^-N #{chain}$/) remove_chains << line.split[1] end end @@ -336,7 +336,7 @@ module SGIPTables remove_chains.each {|c| commands.add :iptables, "-X #{c}" } ipset_list.lines.each do |line| - if line.match(/^#{chain}/) + if line.match(/^#{chain}$/) set = line.strip commands.add :ipset, "destroy #{set}" end