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:
commit
b43bc21b1a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user