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:
Marek Marczykowski-Górecki 2017-02-24 00:38:15 +01:00
parent 1fc6cceb73
commit 58c940b5c0
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 3 additions and 5 deletions

View File

@ -24,8 +24,6 @@ import os
import qubesmgmt.exc import qubesmgmt.exc
class property(object):
DEFAULT = object() DEFAULT = 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',

View File

@ -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):