qubes.vm.__init__ Add docstrings
This commit is contained in:
parent
77d54b55ad
commit
94d9fd040f
@ -122,6 +122,7 @@ class Features(dict):
|
|||||||
_NO_DEFAULT = object()
|
_NO_DEFAULT = object()
|
||||||
|
|
||||||
def check_with_template(self, feature, default=_NO_DEFAULT):
|
def check_with_template(self, feature, default=_NO_DEFAULT):
|
||||||
|
''' Check if the vm's template has the specified feature. '''
|
||||||
if feature in self:
|
if feature in self:
|
||||||
return self[feature]
|
return self[feature]
|
||||||
|
|
||||||
@ -376,10 +377,12 @@ class BaseVM(qubes.PropertyHolder):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def has_firewall(self):
|
def has_firewall(self):
|
||||||
|
''' Return `True` if there are some vm specific firewall rules set '''
|
||||||
return os.path.exists(os.path.join(self.dir_path, self.firewall_conf))
|
return os.path.exists(os.path.join(self.dir_path, self.firewall_conf))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_firewall_defaults():
|
def get_firewall_defaults():
|
||||||
|
''' Returns the default firewall rules '''
|
||||||
return {
|
return {
|
||||||
'rules': list(),
|
'rules': list(),
|
||||||
'allow': True,
|
'allow': True,
|
||||||
@ -388,6 +391,7 @@ class BaseVM(qubes.PropertyHolder):
|
|||||||
'allowYumProxy': False}
|
'allowYumProxy': False}
|
||||||
|
|
||||||
def get_firewall_conf(self):
|
def get_firewall_conf(self):
|
||||||
|
''' Returns the firewall config dictionary '''
|
||||||
conf = self.get_firewall_defaults()
|
conf = self.get_firewall_defaults()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user