qubes.vm.__init__ Fix pylint warnings
This commit is contained in:
parent
f318871279
commit
77d54b55ad
@ -120,6 +120,7 @@ class Features(dict):
|
||||
#
|
||||
|
||||
_NO_DEFAULT = object()
|
||||
|
||||
def check_with_template(self, feature, default=_NO_DEFAULT):
|
||||
if feature in self:
|
||||
return self[feature]
|
||||
@ -200,7 +201,7 @@ class BaseVM(qubes.PropertyHolder):
|
||||
|
||||
for node in self.xml.xpath('./properties/property'):
|
||||
name = node.get('name')
|
||||
if not name in all_names:
|
||||
if name not in all_names:
|
||||
raise TypeError(
|
||||
'property {!r} not applicable to {!r}'.format(
|
||||
name, self.__class__.__name__))
|
||||
@ -211,12 +212,10 @@ class BaseVM(qubes.PropertyHolder):
|
||||
if hasattr(self, 'name'):
|
||||
self.init_log()
|
||||
|
||||
|
||||
def init_log(self):
|
||||
'''Initialise logger for this domain.'''
|
||||
self.log = qubes.log.get_vm_logger(self.name)
|
||||
|
||||
|
||||
def __xml__(self):
|
||||
element = lxml.etree.Element('domain')
|
||||
element.set('id', 'domain-' + str(self.qid))
|
||||
@ -492,7 +491,6 @@ class VMProperty(qubes.property):
|
||||
self.vmclass = vmclass
|
||||
self.allow_none = allow_none
|
||||
|
||||
|
||||
def __set__(self, instance, value):
|
||||
if value is self.__class__.DEFAULT:
|
||||
self.__delete__(instance)
|
||||
|
Loading…
Reference in New Issue
Block a user