firewall: fix Firewall.clone()

New rule require action to be defined, even if will be overwritten a
moment later.
This commit is contained in:
Marek Marczykowski-Górecki 2017-08-06 12:49:19 +02:00
parent a833692c63
commit 0cd25b5350
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -479,7 +479,9 @@ class Firewall(object):
'''
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)
rules.append(new_rule)
self.rules = rules