Remove mistral from the set_deployment_status* workflows
This change removes the mistral workflows from our set_deployment_status function, which called three different mistral workflows. - set_deployment_status_success - set_deployment_status_failed - set_deployment_status_deploying Task: 38660 Story: 2007212 Change-Id: Idc18c245dc9debcf5236170e0aa99277e58d68a3 Signed-off-by: Kevin Carter <kecarter@redhat.com>
This commit is contained in:
parent
13e1c2fe42
commit
219dc82d9f
|
@ -1369,7 +1369,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||
self.assertTrue(fixture.mock_set_deployment_status.called)
|
||||
self.assertEqual(
|
||||
'deploying',
|
||||
fixture.mock_set_deployment_status.call_args[0][1])
|
||||
fixture.mock_set_deployment_status.call_args[-1]['status']
|
||||
)
|
||||
mock_copy.assert_called_once()
|
||||
|
||||
@mock.patch('tripleoclient.utils.copy_clouds_yaml')
|
||||
|
@ -1405,7 +1406,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||
self.assertTrue(fixture.mock_set_deployment_status.called)
|
||||
self.assertEqual(
|
||||
'deploying',
|
||||
fixture.mock_set_deployment_status.call_args[0][1])
|
||||
fixture.mock_set_deployment_status.call_args[-1]['status'])
|
||||
mock_copy.assert_called_once()
|
||||
|
||||
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.'
|
||||
|
@ -1449,7 +1450,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||
self.assertTrue(fixture.mock_set_deployment_status.called)
|
||||
self.assertEqual(
|
||||
'failed',
|
||||
fixture.mock_set_deployment_status.call_args[0][1])
|
||||
fixture.mock_set_deployment_status.call_args[-1]['status'])
|
||||
|
||||
@mock.patch('tripleoclient.utils.copy_clouds_yaml')
|
||||
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.'
|
||||
|
|
|
@ -945,8 +945,10 @@ class DeployOvercloud(command.Command):
|
|||
if parsed_args.config_download:
|
||||
print("Deploying overcloud configuration")
|
||||
deployment.set_deployment_status(
|
||||
self.clients, 'deploying',
|
||||
plan=stack.stack_name)
|
||||
clients=self.clients,
|
||||
plan=stack.stack_name,
|
||||
status='deploying'
|
||||
)
|
||||
|
||||
try:
|
||||
if not parsed_args.config_download_only:
|
||||
|
@ -982,8 +984,10 @@ class DeployOvercloud(command.Command):
|
|||
in_flight_validations=parsed_args.inflight)
|
||||
except Exception:
|
||||
deployment.set_deployment_status(
|
||||
self.clients, 'failed',
|
||||
plan=stack.stack_name)
|
||||
clients=self.clients,
|
||||
plan=stack.stack_name,
|
||||
status='failed'
|
||||
)
|
||||
raise
|
||||
|
||||
# Force fetching of attributes
|
||||
|
|
|
@ -101,7 +101,11 @@ def deploy_and_wait(log, clients, stack, plan_name, verbose_level,
|
|||
orchestration_client, plan_name, marker, action, verbose_events)
|
||||
if not create_result:
|
||||
shell.OpenStackShell().run(["stack", "failures", "list", plan_name])
|
||||
set_deployment_status(clients, 'failed', plan=plan_name)
|
||||
set_deployment_status(
|
||||
clients=clients,
|
||||
plan=plan_name,
|
||||
status='failed'
|
||||
)
|
||||
if stack is None:
|
||||
raise exceptions.DeploymentError("Heat Stack create failed.")
|
||||
else:
|
||||
|
@ -389,35 +393,28 @@ def get_deployment_status(clients, plan):
|
|||
return deployment_status, plan
|
||||
|
||||
|
||||
def set_deployment_status(clients, status='success', **workflow_input):
|
||||
workflow_client = clients.workflow_engine
|
||||
tripleoclients = clients.tripleoclient
|
||||
def set_deployment_status(clients, plan, status):
|
||||
"""Update a given deployment status.
|
||||
|
||||
if status == 'success':
|
||||
workflow = 'tripleo.deployment.v1.set_deployment_status_success'
|
||||
elif status == 'failed':
|
||||
workflow = 'tripleo.deployment.v1.set_deployment_status_failed'
|
||||
elif status == 'deploying':
|
||||
workflow = 'tripleo.deployment.v1.set_deployment_status_deploying'
|
||||
else:
|
||||
raise Exception("Can't set unknown deployment status: %s" % status)
|
||||
:param clients: application client object.
|
||||
:type clients: Object
|
||||
|
||||
with tripleoclients.messaging_websocket() as ws:
|
||||
execution = base.start_workflow(
|
||||
workflow_client,
|
||||
workflow,
|
||||
workflow_input=workflow_input
|
||||
)
|
||||
:param plan: Plan name.
|
||||
:type plan: String
|
||||
|
||||
for payload in base.wait_for_messages(workflow_client, ws, execution,
|
||||
_WORKFLOW_TIMEOUT):
|
||||
# Just continue until workflow is done
|
||||
continue
|
||||
:param status: Current status of the deployment.
|
||||
:type status: String
|
||||
"""
|
||||
|
||||
if payload['status'] != 'SUCCESS':
|
||||
raise exceptions.WorkflowServiceError(
|
||||
'Exception setting deployment status: {}'.format(
|
||||
payload.get('message', '')))
|
||||
deploy_status = 'DEPLOY_{}'.format(status.upper())
|
||||
utils.update_deployment_status(
|
||||
clients=clients,
|
||||
plan=plan,
|
||||
status={
|
||||
'deployment_status': deploy_status,
|
||||
'status_update': deploy_status
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def get_deployment_failures(clients, **workflow_input):
|
||||
|
|
Loading…
Reference in New Issue