Merge "Pass the timeout to the deploy workflow"
This commit is contained in:
@@ -272,7 +272,7 @@ class DeployOvercloud(command.Command):
|
||||
workflow_client)
|
||||
|
||||
deployment.deploy_and_wait(self.log, clients, stack, stack_name,
|
||||
self.app_args.verbose_level)
|
||||
self.app_args.verbose_level, timeout)
|
||||
|
||||
def _load_environment_directories(self, directories):
|
||||
if os.environ.get('TRIPLEO_ENVIRONMENT_DIRECTORY'):
|
||||
|
||||
@@ -123,6 +123,9 @@ class DeployPlan(command.Command):
|
||||
def get_parser(self, prog_name):
|
||||
parser = super(DeployPlan, self).get_parser(prog_name)
|
||||
parser.add_argument('name', help=_('The name of the plan to deploy.'))
|
||||
parser.add_argument('--timeout', '-t', metavar='<TIMEOUT>',
|
||||
type=int,
|
||||
help=_('Deployment timeout in minutes.'))
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
@@ -134,4 +137,5 @@ class DeployPlan(command.Command):
|
||||
|
||||
print("Starting to deploy plan: {}".format(parsed_args.name))
|
||||
deployment.deploy_and_wait(self.log, clients, stack, parsed_args.name,
|
||||
self.app_args.verbose_level)
|
||||
self.app_args.verbose_level,
|
||||
timeout=parsed_args.timeout)
|
||||
|
||||
@@ -40,10 +40,19 @@ def deploy(clients, **workflow_input):
|
||||
assert message['status'] == "SUCCESS", pprint.pformat(message)
|
||||
|
||||
|
||||
def deploy_and_wait(log, clients, stack, plan_name, verbose_level):
|
||||
def deploy_and_wait(log, clients, stack, plan_name, verbose_level,
|
||||
timeout=None):
|
||||
"""Start the deploy and wait for it to finish"""
|
||||
|
||||
deploy(clients, container=plan_name, queue_name=str(uuid.uuid4()))
|
||||
workflow_input = {
|
||||
"container": plan_name,
|
||||
"queue_name": str(uuid.uuid4()),
|
||||
}
|
||||
|
||||
if timeout is not None:
|
||||
workflow_input['timeout'] = timeout
|
||||
|
||||
deploy(clients, **workflow_input)
|
||||
|
||||
orchestration_client = clients.orchestration
|
||||
|
||||
|
||||
Reference in New Issue
Block a user