1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-19 06:50:07 +03:00

Merge pull request #132 from winem/issue-4882

regex match from the beginning to the end of the string in nic_deacti…
This commit is contained in:
Javi Fontan 2016-10-31 11:48:54 +01:00 committed by GitHub
commit b43bc21b1a

View File

@ -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