Browse Source

vm/qubesvm: define 'updateable' as qubes.property

This will allow property being accessed through management API
Marek Marczykowski-Górecki 7 years ago
parent
commit
772293d0b5
1 changed files with 7 additions and 6 deletions
  1. 7 6
      qubes/vm/qubesvm.py

+ 7 - 6
qubes/vm/qubesvm.py

@@ -488,6 +488,13 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
         default=(lambda self: self.app.default_dispvm),
         doc='Default VM to be used as Disposable VM for service calls.')
 
+
+    updateable = qubes.property('updateable',
+        default=(lambda self: not hasattr(self, 'template')),
+        type=bool,
+        setter=qubes.property.forbidden,
+        doc='True if this machine may be updated on its own.')
+
     #
     # static, class-wide properties
     #
@@ -575,12 +582,6 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
                 self._qdb_connection = qubesdb.QubesDB(self.name)
         return self._qdb_connection
 
-    # XXX shouldn't this go elsewhere?
-    @property
-    def updateable(self):
-        '''True if this machine may be updated on its own.'''
-        return not hasattr(self, 'template')
-
     @property
     def dir_path(self):
         '''Root directory for files related to this domain'''