summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-07-28 17:07:31 +0000
committerGerrit Code Review <review@openstack.org>2020-07-28 17:07:31 +0000
commit622ca733e2641b9c59e213a26749e9e76d3ea43d (patch)
treedf281a955a5a2d3590917554d66671c4697397b3
parent80657dcc172bc5d6e9bb5cdb70f877f17b354591 (diff)
parenteb8765149627f83384e8e639882c86c71b21b112 (diff)
downloadironic-python-agent-622ca733e2641b9c59e213a26749e9e76d3ea43d.tar.gz
Merge "Allow erase_devices_metadata to be used as a deploy step"
-rw-r--r--ironic_python_agent/hardware.py6
-rw-r--r--ironic_python_agent/tests/unit/test_hardware.py8
-rw-r--r--releasenotes/notes/erase-deploy-step-3e952fa863bca908.yaml5
3 files changed, 19 insertions, 0 deletions
diff --git a/ironic_python_agent/hardware.py b/ironic_python_agent/hardware.py
index ea06bb40..00ccb930 100644
--- a/ironic_python_agent/hardware.py
+++ b/ironic_python_agent/hardware.py
@@ -1584,6 +1584,12 @@ class GenericHardwareManager(HardwareManager):
def get_deploy_steps(self, node, ports):
return [
{
+ 'step': 'erase_devices_metadata',
+ 'priority': 0,
+ 'interface': 'deploy',
+ 'reboot_requested': False,
+ },
+ {
'step': 'apply_configuration',
'priority': 0,
'interface': 'raid',
diff --git a/ironic_python_agent/tests/unit/test_hardware.py b/ironic_python_agent/tests/unit/test_hardware.py
index 63ccb1d0..c2516bd0 100644
--- a/ironic_python_agent/tests/unit/test_hardware.py
+++ b/ironic_python_agent/tests/unit/test_hardware.py
@@ -881,6 +881,14 @@ class TestGenericHardwareManager(base.IronicAgentTest):
clean_steps = self.hardware.get_clean_steps(self.node, [])
self.assertEqual(expected_clean_steps, clean_steps)
+ def test_clean_steps_exist(self):
+ for step in self.hardware.get_clean_steps(self.node, []):
+ getattr(self.hardware, step['step'])
+
+ def test_deploy_steps_exist(self):
+ for step in self.hardware.get_deploy_steps(self.node, []):
+ getattr(self.hardware, step['step'])
+
@mock.patch('binascii.hexlify', autospec=True)
@mock.patch('ironic_python_agent.netutils.get_lldp_info', autospec=True)
def test_collect_lldp_data(self, mock_lldp_info, mock_hexlify):
diff --git a/releasenotes/notes/erase-deploy-step-3e952fa863bca908.yaml b/releasenotes/notes/erase-deploy-step-3e952fa863bca908.yaml
new file mode 100644
index 00000000..971e3067
--- /dev/null
+++ b/releasenotes/notes/erase-deploy-step-3e952fa863bca908.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - |
+ The ``deploy.erase_devices_metadata`` clean step can now also be used as
+ a deploy step.