summaryrefslogtreecommitdiff
path: root/heatclient/osc
diff options
context:
space:
mode:
authorPavlo Shchelokovskyy <shchelokovskyy@gmail.com>2019-01-25 11:47:31 +0200
committerPavlo Shchelokovskyy <pshchelokovskyy@mirantis.com>2019-09-25 08:57:33 +0000
commit033511c291c811f9368aaccdc81de3c9c93c9ae2 (patch)
tree068e68dbbea9ec8ed89d6e90274b55fffa3c60a5 /heatclient/osc
parent4d8f270157bf2e56ede62c61985c8fad41daceb7 (diff)
downloadpython-heatclient-033511c291c811f9368aaccdc81de3c9c93c9ae2.tar.gz
Allow to set poll interval to OSC stack create
In certain scenarios the default poll interval of 5s used by `openstack stack create --wait` command is too short. Setting the poll interval was supported in heat CLI with `heat stack-create --poll N` but is missing in OSC plugin. This patch adds an optional argument `--poll N` (N defaults to 5) to the `openstack stack create` command. Change-Id: Id279d92ea890032f280e453b795ede2818ffbb8c Story: 2004863 Task: 29106
Diffstat (limited to 'heatclient/osc')
-rw-r--r--heatclient/osc/v1/stack.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/heatclient/osc/v1/stack.py b/heatclient/osc/v1/stack.py
index bdf7f5f..761b323 100644
--- a/heatclient/osc/v1/stack.py
+++ b/heatclient/osc/v1/stack.py
@@ -91,6 +91,14 @@ class CreateStack(command.ShowOne):
help=_('Wait until stack goes to CREATE_COMPLETE or CREATE_FAILED')
)
parser.add_argument(
+ '--poll',
+ metavar='SECONDS',
+ type=int,
+ default=5,
+ help=_('Poll interval in seconds for use with --wait, '
+ 'defaults to 5.')
+ )
+ parser.add_argument(
'--tags',
metavar='<tag1,tag2...>',
help=_('A list of tags to associate with the stack')
@@ -184,7 +192,8 @@ class CreateStack(command.ShowOne):
stack = client.stacks.create(**fields)['stack']
if parsed_args.wait:
stack_status, msg = event_utils.poll_for_events(
- client, parsed_args.name, action='CREATE')
+ client, parsed_args.name, action='CREATE',
+ poll_period=parsed_args.poll)
if stack_status == 'CREATE_FAILED':
raise exc.CommandError(msg)