Explorar o código

qubes/vm: Fix instantiating QubesVM

vm.app attribute needs to be accessible before setting properties
Wojtek Porczyk %!s(int64=9) %!d(string=hai) anos
pai
achega
ea9a984fa7
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      qubes/vm/__init__.py

+ 4 - 1
qubes/vm/__init__.py

@@ -148,11 +148,14 @@ class BaseVM(qubes.PropertyHolder):
     def __init__(self, app, xml, services=None, devices=None, tags=None,
             **kwargs):
         # pylint: disable=redefined-outer-name
-        super(BaseVM, self).__init__(xml, **kwargs)
 
+        # self.app must be set before super().__init__, because some property
+        # setters need working .app attribute
         #: mother :py:class:`qubes.Qubes` object
         self.app = app
 
+        super(BaseVM, self).__init__(xml, **kwargs)
+
         #: dictionary of services that are run on this domain
         self.services = services or {}