From f6e48cb3ff880f6ed535bd73ae44f878c5fd1d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 11 Mar 2017 00:58:53 +0100 Subject: [PATCH] Rename methods for global properties Finally we've settled for `mgmt.property.`, instead of `mgmt.global.property.` prefix. QubesOS/qubes-issues#853 --- qubesmgmt/app.py | 2 +- qubesmgmt/tests/tools/qubes_prefs.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qubesmgmt/app.py b/qubesmgmt/app.py index 8e66d3b..173de46 100644 --- a/qubesmgmt/app.py +++ b/qubesmgmt/app.py @@ -107,7 +107,7 @@ class QubesBase(qubesmgmt.base.PropertyHolder): domains = None def __init__(self): - super(QubesBase, self).__init__(self, 'mgmt.global.property.', 'dom0') + super(QubesBase, self).__init__(self, 'mgmt.property.', 'dom0') self.domains = VMCollection(self) diff --git a/qubesmgmt/tests/tools/qubes_prefs.py b/qubesmgmt/tests/tools/qubes_prefs.py index 0ebdff8..6aee233 100644 --- a/qubesmgmt/tests/tools/qubes_prefs.py +++ b/qubesmgmt/tests/tools/qubes_prefs.py @@ -26,13 +26,13 @@ import qubesmgmt.tools.qubes_prefs class TC_00_qubes_prefs(qubesmgmt.tests.QubesTestCase): def test_000_list(self): self.app.expected_calls[ - ('dom0', 'mgmt.global.property.List', None, None)] = \ + ('dom0', 'mgmt.property.List', None, None)] = \ b'0\x00prop1\nprop2\n' self.app.expected_calls[ - ('dom0', 'mgmt.global.property.Get', 'prop1', None)] = \ + ('dom0', 'mgmt.property.Get', 'prop1', None)] = \ b'0\x00default=True \'value1\'' self.app.expected_calls[ - ('dom0', 'mgmt.global.property.Get', 'prop2', None)] = \ + ('dom0', 'mgmt.property.Get', 'prop2', None)] = \ b'0\x00default=False \'value2\'' with qubesmgmt.tests.tools.StdoutBuffer() as stdout: self.assertEqual(0, qubesmgmt.tools.qubes_prefs.main([], app=self.app)) @@ -43,7 +43,7 @@ class TC_00_qubes_prefs(qubesmgmt.tests.QubesTestCase): def test_002_set_property(self): self.app.expected_calls[ - ('dom0', 'mgmt.global.property.Set', 'default_user', b'testuser')]\ + ('dom0', 'mgmt.property.Set', 'default_user', b'testuser')]\ = b'0\x00' self.assertEqual(0, qubesmgmt.tools.qubes_prefs.main([ 'default_user', 'testuser'], app=self.app)) @@ -51,7 +51,7 @@ class TC_00_qubes_prefs(qubesmgmt.tests.QubesTestCase): def test_003_invalid_property(self): self.app.expected_calls[ - ('dom0', 'mgmt.global.property.Get', 'no_such_property', None)] = \ + ('dom0', 'mgmt.property.Get', 'no_such_property', None)] = \ b'2\x00AttributeError\x00\x00no_such_property\x00' with self.assertRaises(SystemExit): qubesmgmt.tools.qubes_prefs.main([ @@ -60,7 +60,7 @@ class TC_00_qubes_prefs(qubesmgmt.tests.QubesTestCase): def test_004_set_invalid_property(self): self.app.expected_calls[ - ('dom0', 'mgmt.global.property.Set', 'no_such_property', b'value')]\ + ('dom0', 'mgmt.property.Set', 'no_such_property', b'value')]\ = b'2\x00AttributeError\x00\x00no_such_property\x00' with self.assertRaises(SystemExit): qubesmgmt.tools.qubes_prefs.main([