Skip to content

Commit

Permalink
qubes/firewall: make xml parameter to Rule optional
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Sep 19, 2016
1 parent dbec3b3 commit 51e3e31
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions qubes/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,12 @@ def rule(self):


class Rule(qubes.PropertyHolder):
def __init__(self, xml, **kwargs):
def __init__(self, xml=None, **kwargs):
'''Single firewall rule
:param xml: XML element describing rule, or None
:param kwargs: rule elements
'''
super(Rule, self).__init__(xml, **kwargs)
self.load_properties()
self.events_enabled = True
Expand Down Expand Up @@ -347,7 +352,7 @@ def from_xml_v1(cls, node, action):
if expire:
kwargs['expire'] = expire

return cls(None, **kwargs)
return cls(**kwargs)

def __eq__(self, other):
return self.rule == other.rule
Expand Down

0 comments on commit 51e3e31

Please sign in to comment.