From 772293d0b53d78318338c1966e9116c31630aa8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 11 Mar 2017 00:06:02 +0100 Subject: [PATCH] vm/qubesvm: define 'updateable' as qubes.property This will allow property being accessed through management API --- qubes/vm/qubesvm.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 6af8add1..bab2d012 100644 --- a/qubes/vm/qubesvm.py +++ b/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'''