From 203dd5210c91aae2833bbf8e49fcaa9cfd57f267 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Mon, 31 Oct 2016 11:48:54 +0100 Subject: [PATCH] Merge pull request #132 from winem/issue-4882 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit regex match from the beginning to the end of the string in nic_deacti… --- 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..6eb921d0f0 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