tripleo_deploy/upgrade: fail of upgrade_tasks don't return 0

We only want to run the deploy_tasks in one of these situations:
- upgrade_tasks finished with success (return code 0)
- upgrade_tasks aren't executed (then it's a classic deployment)

But we don't want to run the deploy_tasks when upgrade_tasks failed, we
want to fail early in the upgrade process and provide the feedback to
the operator.

Change-Id: I1b9e8b246ebb5e6f0e9ec692912b9d9df9dd5dbc
Closes-Bug: #1772804
This commit is contained in:
Emilien Macchi 2018-05-23 23:24:45 -07:00
parent 9cc04d25f3
commit 72449c8e40
1 changed files with 2 additions and 0 deletions

View File

@ -763,6 +763,8 @@ class Deploy(command.Command):
# Run Upgrade tasks before the deployment
if parsed_args.upgrade:
rc = self._launch_ansible_upgrade(ansible_dir)
if rc != 0:
raise exceptions.DeploymentError('Upgrade failed')
rc = self._launch_ansible_deploy(ansible_dir)
except Exception as e:
self.log.error("Exception: %s" % e)