Implement get_deploy_steps for AgentRAID
This allows using software RAID as an in-band deploy step. Change-Id: I66103598cf58267010a09b1bd654dc90f714c202
This commit is contained in:
@@ -622,6 +622,18 @@ class AgentRAID(base.RAIDInterface):
|
|||||||
"""Return the properties of the interface."""
|
"""Return the properties of the interface."""
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
@METRICS.timer('AgentRAID.get_deploy_steps')
|
||||||
|
def get_deploy_steps(self, task):
|
||||||
|
"""Get the list of deploy steps from the agent.
|
||||||
|
|
||||||
|
:param task: a TaskManager object containing the node
|
||||||
|
:raises InstanceDeployFailure: if the deploy steps are not yet
|
||||||
|
available (cached), for example, when a node has just been
|
||||||
|
enrolled and has not been deployed yet.
|
||||||
|
:returns: A list of deploy step dictionaries
|
||||||
|
"""
|
||||||
|
return agent_base.get_steps(task, 'deploy', interface='raid')
|
||||||
|
|
||||||
@METRICS.timer('AgentRAID.create_configuration')
|
@METRICS.timer('AgentRAID.create_configuration')
|
||||||
@base.clean_step(priority=0)
|
@base.clean_step(priority=0)
|
||||||
def create_configuration(self, task,
|
def create_configuration(self, task,
|
||||||
|
@@ -1649,6 +1649,18 @@ class AgentRAIDTestCase(db_base.DbTestCase):
|
|||||||
self.assertEqual(0, ret[0]['priority'])
|
self.assertEqual(0, ret[0]['priority'])
|
||||||
self.assertEqual(0, ret[1]['priority'])
|
self.assertEqual(0, ret[1]['priority'])
|
||||||
|
|
||||||
|
@mock.patch.object(agent_base, 'get_steps', autospec=True)
|
||||||
|
def test_get_deploy_steps(self, get_steps_mock):
|
||||||
|
get_steps_mock.return_value = [
|
||||||
|
{'step': 'apply_configuration', 'interface': 'raid',
|
||||||
|
'priority': 0},
|
||||||
|
]
|
||||||
|
|
||||||
|
with task_manager.acquire(self.context, self.node.uuid) as task:
|
||||||
|
ret = task.driver.raid.get_deploy_steps(task)
|
||||||
|
|
||||||
|
self.assertEqual('apply_configuration', ret[0]['step'])
|
||||||
|
|
||||||
@mock.patch.object(raid, 'filter_target_raid_config', autospec=True)
|
@mock.patch.object(raid, 'filter_target_raid_config', autospec=True)
|
||||||
@mock.patch.object(agent_base, 'execute_step', autospec=True)
|
@mock.patch.object(agent_base, 'execute_step', autospec=True)
|
||||||
def test_create_configuration(self, execute_mock,
|
def test_create_configuration(self, execute_mock,
|
||||||
|
5
releasenotes/notes/agent-raid-647acfd599e83476.yaml
Normal file
5
releasenotes/notes/agent-raid-647acfd599e83476.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The ``agent`` RAID interface now supports building RAID as a deploy step
|
||||||
|
``apply_configuration``.
|
Reference in New Issue
Block a user