mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 20:02:38 +09: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:
1 parent
db337d8ea1
commit
203dd5210c
1 file changed
+2
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user