Fix setting VM property to None
None value should be encoded as empty string.
This commit is contained in:
parent
1aab64d5b0
commit
c988ef41a3
@ -211,6 +211,8 @@ class PropertyHolder(object):
|
||||
else:
|
||||
if isinstance(value, qubesadmin.vm.QubesVM):
|
||||
value = value.name
|
||||
if value is None:
|
||||
value = ''
|
||||
try:
|
||||
self.qubesd_call(
|
||||
self._method_dest,
|
||||
|
@ -145,7 +145,7 @@ class TC_00_Properties(qubesadmin.tests.vm.VMTestCase):
|
||||
|
||||
def test_024_set_none(self):
|
||||
self.app.expected_calls[
|
||||
('test-vm', 'admin.vm.property.Set', 'prop1', b'None')] = \
|
||||
('test-vm', 'admin.vm.property.Set', 'prop1', b'')] = \
|
||||
b'0\x00'
|
||||
self.vm.prop1 = None
|
||||
self.assertAllCalled()
|
||||
|
Loading…
Reference in New Issue
Block a user