Allow erase_devices_metadata to be used as a deploy step

Change-Id: I75f156dd76b0e3aaa1592ba24fe42fb2a7057cc8
Story: #2006963
This commit is contained in:
Dmitry Tantsur 2020-07-27 17:54:50 +02:00
parent dc395c5837
commit eb87651496
3 changed files with 19 additions and 0 deletions

View File

@ -1583,6 +1583,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,

View File

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

View File

@ -0,0 +1,5 @@
---
features:
- |
The ``deploy.erase_devices_metadata`` clean step can now also be used as
a deploy step.