Rename qubesmgmt.property.DEFAULT to qubesmgmt.DEFAULT
Don't shadow builtin 'property' type. We don't need to kee compatibility with actual core3 implementation yet, so don't make the same mistake twice.
This commit is contained in:
parent
1fc6cceb73
commit
58c940b5c0
@ -24,9 +24,7 @@ import os
|
|||||||
|
|
||||||
import qubesmgmt.exc
|
import qubesmgmt.exc
|
||||||
|
|
||||||
|
DEFAULT = object()
|
||||||
class property(object):
|
|
||||||
DEFAULT = object()
|
|
||||||
|
|
||||||
|
|
||||||
class PropertyHolder(object):
|
class PropertyHolder(object):
|
||||||
@ -124,7 +122,7 @@ class PropertyHolder(object):
|
|||||||
def __setattr__(self, key, value):
|
def __setattr__(self, key, value):
|
||||||
if key.startswith('_') or key in dir(self):
|
if key.startswith('_') or key in dir(self):
|
||||||
return super(PropertyHolder, self).__setattr__(key, value)
|
return super(PropertyHolder, self).__setattr__(key, value)
|
||||||
if value is property.DEFAULT:
|
if value is DEFAULT:
|
||||||
self._do_qubesd_call(
|
self._do_qubesd_call(
|
||||||
self._method_dest,
|
self._method_dest,
|
||||||
self._method_prefix + 'Reset',
|
self._method_prefix + 'Reset',
|
||||||
|
@ -121,7 +121,7 @@ class TC_00_Properties(qubesmgmt.tests.vm.VMTestCase):
|
|||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('test-vm', 'mgmt.vm.property.Reset', 'prop1', None)] = \
|
('test-vm', 'mgmt.vm.property.Reset', 'prop1', None)] = \
|
||||||
b'0\x00'
|
b'0\x00'
|
||||||
self.vm.prop1 = qubesmgmt.property.DEFAULT
|
self.vm.prop1 = qubesmgmt.DEFAULT
|
||||||
self.assertAllCalled()
|
self.assertAllCalled()
|
||||||
|
|
||||||
def test_031_reset(self):
|
def test_031_reset(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user