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

This will allow property being accessed through management API
This commit is contained in:
Marek Marczykowski-Górecki 2017-03-11 00:06:02 +01:00
parent f7eabf8eb0
commit 772293d0b5
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -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'''