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

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
This commit is contained in:
Emilien Macchi 2020-07-28 10:35:14 -04:00
parent 9c03d2b18f
commit 9dec1b2e33
1 changed files with 17 additions and 17 deletions

View File

@ -1040,6 +1040,18 @@ class DeployOvercloud(command.Command):
return
try:
# Force fetching of attributes
stack.get()
rcpath = deployment.create_overcloudrc(
container=stack.stack_name,
no_proxy=parsed_args.no_proxy)
overcloud_endpoint = utils.get_overcloud_endpoint(stack)
horizon_url = deployment.get_horizon_url(
stack=stack.stack_name)
if parsed_args.config_download:
print("Deploying overcloud configuration")
deployment.set_deployment_status(
@ -1104,29 +1116,17 @@ class DeployOvercloud(command.Command):
status=deploy_status
)
finally:
# Force fetching of attributes
stack.get()
rcpath = deployment.create_overcloudrc(
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)
utils.create_tempest_deployer_input()
# Run postconfig on create or force. Use force to makes sure
# endpoints are created with deploy reruns and upgrades
if (stack_create or parsed_args.force_postconfig
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(
stack=stack.stack_name)
# 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)
utils.create_tempest_deployer_input()
print("Overcloud Endpoint: {0}".format(overcloud_endpoint))
print("Overcloud Horizon Dashboard URL: {0}".format(