Remove the mistral from the create_raid_configuration workflow
This change removes all of mistral from the create_raid_configuration workflows by calling the new cleaning playbook. Story: 2007212 Task: 38449 Depends-On: I51b1977b53995c93eb661f9ffa6d7cbad033ab75 Change-Id: If2f894316c3369432b16e07d68beee3a7d174b6a Signed-off-by: Kevin Carter <kecarter@redhat.com>
This commit is contained in:
parent
5a99ff8e1f
commit
6d56817524
|
@ -49,6 +49,12 @@ class TestCreateRAID(fakes.TestBaremetal):
|
||||||
)
|
)
|
||||||
execution.id = "IDID"
|
execution.id = "IDID"
|
||||||
self.workflow.executions.create.return_value = execution
|
self.workflow.executions.create.return_value = execution
|
||||||
|
playbook_runner = mock.patch(
|
||||||
|
'tripleoclient.utils.run_ansible_playbook',
|
||||||
|
autospec=True
|
||||||
|
)
|
||||||
|
playbook_runner.start()
|
||||||
|
self.addCleanup(playbook_runner.stop)
|
||||||
|
|
||||||
def test_ok(self):
|
def test_ok(self):
|
||||||
conf = json.dumps(self.conf)
|
conf = json.dumps(self.conf)
|
||||||
|
@ -61,14 +67,6 @@ class TestCreateRAID(fakes.TestBaremetal):
|
||||||
|
|
||||||
self.cmd.take_action(parsed_args)
|
self.cmd.take_action(parsed_args)
|
||||||
|
|
||||||
self.workflow.executions.create.assert_called_once_with(
|
|
||||||
'tripleo.baremetal.v1.create_raid_configuration',
|
|
||||||
workflow_input={
|
|
||||||
'node_uuids': ['uuid1', 'uuid2'],
|
|
||||||
'configuration': self.conf,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_from_file(self):
|
def test_from_file(self):
|
||||||
with tempfile.NamedTemporaryFile('w+t') as fp:
|
with tempfile.NamedTemporaryFile('w+t') as fp:
|
||||||
json.dump(self.conf, fp)
|
json.dump(self.conf, fp)
|
||||||
|
@ -82,14 +80,6 @@ class TestCreateRAID(fakes.TestBaremetal):
|
||||||
|
|
||||||
self.cmd.take_action(parsed_args)
|
self.cmd.take_action(parsed_args)
|
||||||
|
|
||||||
self.workflow.executions.create.assert_called_once_with(
|
|
||||||
'tripleo.baremetal.v1.create_raid_configuration',
|
|
||||||
workflow_input={
|
|
||||||
'node_uuids': ['uuid1', 'uuid2'],
|
|
||||||
'configuration': self.conf,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_no_nodes(self):
|
def test_no_nodes(self):
|
||||||
arglist = ['{}']
|
arglist = ['{}']
|
||||||
verifylist = [
|
verifylist = [
|
||||||
|
|
|
@ -19,7 +19,9 @@ import six
|
||||||
from tripleo_common.actions import baremetal
|
from tripleo_common.actions import baremetal
|
||||||
from tripleo_common.actions import baremetal_deploy
|
from tripleo_common.actions import baremetal_deploy
|
||||||
|
|
||||||
|
from tripleoclient import constants
|
||||||
from tripleoclient import exceptions
|
from tripleoclient import exceptions
|
||||||
|
from tripleoclient import utils
|
||||||
from tripleoclient.workflows import base
|
from tripleoclient.workflows import base
|
||||||
|
|
||||||
|
|
||||||
|
@ -297,33 +299,32 @@ def configure_manageable_nodes(clients, **workflow_input):
|
||||||
print(payload['message'])
|
print(payload['message'])
|
||||||
|
|
||||||
|
|
||||||
def create_raid_configuration(clients, **workflow_input):
|
def create_raid_configuration(clients, node_uuids, configuration):
|
||||||
"""Create RAID configuration on nodes.
|
"""Create RAID configuration on nodes.
|
||||||
|
|
||||||
Run the tripleo.baremetal.v1.create_raid_configuration Mistral workflow.
|
:param clients: application client object.
|
||||||
|
:type clients: Object
|
||||||
|
|
||||||
|
:param node_uuids: List of instance UUID(s).
|
||||||
|
:type node_uuids: List
|
||||||
|
|
||||||
|
:param node_uuids: List of instance UUID(s).
|
||||||
|
:type node_uuids: List
|
||||||
"""
|
"""
|
||||||
|
|
||||||
workflow_client = clients.workflow_engine
|
with utils.TempDirs() as tmp:
|
||||||
ooo_client = clients.tripleoclient
|
utils.run_ansible_playbook(
|
||||||
|
playbook='cli-baremetal-raid.yaml',
|
||||||
print('Creating RAID configuration for given nodes, this may take time')
|
inventory='localhost,',
|
||||||
|
workdir=tmp,
|
||||||
with ooo_client.messaging_websocket() as ws:
|
playbook_dir=constants.ANSIBLE_TRIPLEO_PLAYBOOKS,
|
||||||
execution = base.start_workflow(
|
extra_vars={
|
||||||
workflow_client,
|
'node_uuids': node_uuids,
|
||||||
'tripleo.baremetal.v1.create_raid_configuration',
|
'raid_configuration': configuration
|
||||||
workflow_input=workflow_input
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
for payload in base.wait_for_messages(workflow_client, ws, execution):
|
print('Successfully configured RAID for nodes: {}'.format(node_uuids))
|
||||||
if 'message' in payload:
|
|
||||||
print(payload['message'])
|
|
||||||
|
|
||||||
if payload['status'] == 'SUCCESS':
|
|
||||||
print('Success')
|
|
||||||
else:
|
|
||||||
raise RuntimeError(
|
|
||||||
'Failed to create RAID: {}'.format(payload['message']))
|
|
||||||
|
|
||||||
|
|
||||||
def discover_and_enroll(clients, ip_addresses, credentials, kernel_name,
|
def discover_and_enroll(clients, ip_addresses, credentials, kernel_name,
|
||||||
|
|
Loading…
Reference in New Issue