summaryrefslogtreecommitdiff
path: root/ironic_python_agent/tests/extensions/decom.py
diff options
context:
space:
mode:
authorJay Faulkner <jay@jvf.cc>2014-12-19 13:24:21 -0800
committerJay Faulkner <jay@jvf.cc>2015-01-08 15:15:13 -0800
commit2bbec5770c459b339b0924e8ffcd1382e22d44df (patch)
tree1a1035f408aa3d1557a9d91772c4f5f71e820c2f /ironic_python_agent/tests/extensions/decom.py
parent8dd54446e3a7a1e13fee91a4f7cfa064b085b03b (diff)
downloadironic-python-agent-2bbec5770c459b339b0924e8ffcd1382e22d44df.tar.gz
Allow use of multiple simultaneous HW managers
Currently we pick the most specific manager and use it. Instead, call each method on each hardware manager in priority order, and consider the call successful if the method exists and doesn't throw IncompatibleHardwareMethodError. This is an API breaking change for anyone with out-of-tree HardwareManagers. Closes-bug: 1408469 Change-Id: I30c65c9259acd4f200cb554e7d688344b7486a58
Diffstat (limited to 'ironic_python_agent/tests/extensions/decom.py')
-rw-r--r--ironic_python_agent/tests/extensions/decom.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ironic_python_agent/tests/extensions/decom.py b/ironic_python_agent/tests/extensions/decom.py
index 2101d237..cfa01dd4 100644
--- a/ironic_python_agent/tests/extensions/decom.py
+++ b/ironic_python_agent/tests/extensions/decom.py
@@ -23,9 +23,9 @@ class TestDecomExtension(test_base.BaseTestCase):
super(TestDecomExtension, self).setUp()
self.agent_extension = decom.DecomExtension()
- @mock.patch('ironic_python_agent.hardware.get_manager', autospec=True)
- def test_erase_hardware(self, mocked_get_manager):
- hardware_manager = mocked_get_manager.return_value
+ @mock.patch('ironic_python_agent.hardware.dispatch_to_managers',
+ autospec=True)
+ def test_erase_devices(self, mocked_dispatch):
result = self.agent_extension.erase_hardware()
result.join()
- hardware_manager.erase_devices.assert_called_once_with()
+ mocked_dispatch.assert_called_once_with('erase_devices')