dom0/core: implement per-VM-type firewall defaults

This commit is contained in:
Marek Marczykowski 2012-06-05 19:37:12 +02:00
parent 8023c66020
commit 01e8a2dff9

View File

@ -1223,8 +1223,11 @@ class QubesVm(object):
def has_firewall(self):
return os.path.exists (self.firewall_conf)
def get_firewall_defaults(self):
return { "rules": list(), "allow": True, "allowDns": True, "allowIcmp": True, "allowYumProxy": False }
def get_firewall_conf(self):
conf = { "rules": list(), "allow": True, "allowDns": True, "allowIcmp": True, "allowYumProxy": False }
conf = self.get_firewall_defaults()
try:
tree = xml.etree.ElementTree.parse(self.firewall_conf)