diff --git a/tripleoclient/v1/overcloud_deploy.py b/tripleoclient/v1/overcloud_deploy.py index 2e9b7bbb2..9ea75ac3b 100644 --- a/tripleoclient/v1/overcloud_deploy.py +++ b/tripleoclient/v1/overcloud_deploy.py @@ -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'): diff --git a/tripleoclient/v1/overcloud_plan.py b/tripleoclient/v1/overcloud_plan.py index 17311ccbc..e4e21b835 100644 --- a/tripleoclient/v1/overcloud_plan.py +++ b/tripleoclient/v1/overcloud_plan.py @@ -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='', + 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) diff --git a/tripleoclient/workflows/deployment.py b/tripleoclient/workflows/deployment.py index 21cfbaab3..01458b6e8 100644 --- a/tripleoclient/workflows/deployment.py +++ b/tripleoclient/workflows/deployment.py @@ -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