firewall: fix Firewall.clone()
New rule require action to be defined, even if will be overwritten a moment later.
This commit is contained in:
parent
a833692c63
commit
0cd25b5350
@ -479,7 +479,9 @@ class Firewall(object):
|
|||||||
'''
|
'''
|
||||||
rules = []
|
rules = []
|
||||||
for rule in other.rules:
|
for rule in other.rules:
|
||||||
new_rule = Rule()
|
# Rule constructor require some action, will be overwritten by
|
||||||
|
# clone_properties below
|
||||||
|
new_rule = Rule(action='drop')
|
||||||
new_rule.clone_properties(rule)
|
new_rule.clone_properties(rule)
|
||||||
rules.append(new_rule)
|
rules.append(new_rule)
|
||||||
self.rules = rules
|
self.rules = rules
|
||||||
|
Loading…
Reference in New Issue
Block a user