overcloud_deploy: move horizon url/rc files before config-download

Note: this is an unclean backport.

When a deployment fails, we run the playbooks to generate horizon URL &
RC files anyway. However it is confusing to have them at the end, after
the actual trace and an operator with a small screen won't see the
actual errors easily.

Let's just move these actions before the config download execution,
which has no impact anyway; but will improve logging a lot.

Change-Id: I70bbc40f8e5eb709d9f0f608e936a818e082918b
Related-Bug: #1889212
(cherry picked from commit 9dec1b2e33)
This commit is contained in:
Emilien Macchi 2020-07-28 10:35:14 -04:00
parent 1399785a59
commit fa0129963b
1 changed files with 13 additions and 13 deletions

View File

@ -1011,6 +1011,19 @@ class DeployOvercloud(command.Command):
return
try:
# Force fetching of attributes
stack.get()
overcloudrcs = deployment.create_overcloudrc(
self.clients, container=stack.stack_name,
no_proxy=parsed_args.no_proxy)
rcpath = utils.write_overcloudrc(stack.stack_name, overcloudrcs)
overcloud_endpoint = utils.get_overcloud_endpoint(stack)
horizon_url = deployment.get_horizon_url(
self.clients, stack=stack.stack_name)
if parsed_args.config_download:
print("Deploying overcloud configuration")
deployment.set_deployment_status(
@ -1064,17 +1077,9 @@ class DeployOvercloud(command.Command):
self.clients, deploy_status,
plan=stack.stack_name)
finally:
# Force fetching of attributes
stack.get()
overcloudrcs = deployment.create_overcloudrc(
self.clients, container=stack.stack_name,
no_proxy=parsed_args.no_proxy)
# Copy clouds.yaml to the cloud user directory
user = getpwuid(os.stat(constants.CLOUD_HOME_DIR).st_uid).pw_name
utils.copy_clouds_yaml(user)
rcpath = utils.write_overcloudrc(stack.stack_name, overcloudrcs)
utils.create_tempest_deployer_input()
# Run postconfig on create or force. Use force to makes sure
@ -1083,11 +1088,6 @@ class DeployOvercloud(command.Command):
and not parsed_args.skip_postconfig):
self._deploy_postconfig(stack, parsed_args)
overcloud_endpoint = utils.get_overcloud_endpoint(stack)
horizon_url = deployment.get_horizon_url(
self.clients, stack=stack.stack_name)
print("Overcloud Endpoint: {0}".format(overcloud_endpoint))
print("Overcloud Horizon Dashboard URL: {0}".format(horizon_url))
print("Overcloud rc file: {0}".format(rcpath))