Handle KeyboardInterrupt with overcloud deploy

Currently it prints "overcloud deployed successfully"
after you hit ctrl-c and deployment has been aborted.

Also fixes message logged for ephemeral heat.

Change-Id: I9a9dd37b3197f268f8f2aaab0976ee6d6cc1c21d
(cherry picked from commit 1f316538d1)
This commit is contained in:
ramishra 2021-05-18 12:25:10 +05:30 committed by James Slagle
parent 51347c4044
commit 38317489e8
1 changed files with 10 additions and 14 deletions

View File

@ -19,6 +19,7 @@ import os
import os.path
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from prettytable import PrettyTable
from pwd import getpwuid
import re
@ -689,8 +690,7 @@ class DeployOvercloud(command.Command):
return [output_path]
def setup_ephemeral_heat(self, parsed_args, parameters):
self.log.info("Using tripleo-deploy with "
"ephemeral heat-all for stack operation")
self.log.info("Using ephemeral heat for stack operation")
api_container_image = parameters['ContainerHeatApiImage']
engine_container_image = \
parameters['ContainerHeatEngineImage']
@ -1276,15 +1276,14 @@ class DeployOvercloud(command.Command):
stack.stack_name,
status=deploy_status,
working_dir=self.working_dir)
except Exception as deploy_e:
deploy_status = 'DEPLOY_FAILED'
deploy_message = 'with error'
deploy_trace = deploy_e
deployment.set_deployment_status(
stack.stack_name,
status=deploy_status,
working_dir=self.working_dir
)
except (BaseException, Exception):
with excutils.save_and_reraise_exception():
deploy_status = 'DEPLOY_FAILED'
deploy_message = 'with error'
deployment.set_deployment_status(
stack.stack_name,
status=deploy_status,
working_dir=self.working_dir)
finally:
try:
# Run postconfig on create or force
@ -1355,9 +1354,6 @@ class DeployOvercloud(command.Command):
self.log.error('Exception archiving deploy artifacts')
self.log.error(e)
if deploy_status == 'DEPLOY_FAILED':
raise(deploy_trace)
class GetDeploymentStatus(command.Command):
"""Get deployment status"""