diff options
author | Steven Hardy <shardy@redhat.com> | 2014-03-10 18:21:10 +0000 |
---|---|---|
committer | Steven Hardy <shardy@redhat.com> | 2014-03-10 18:21:10 +0000 |
commit | 38098938be46998b651060c81fa92a9ecad562f6 (patch) | |
tree | 46a8dc41b6b7e5c3773d5b275ccdd96dff1f29cf /heatclient/shell.py | |
parent | aa30e4642a5e71b6149dfc29821d4d85da410cc9 (diff) | |
download | python-heatclient-38098938be46998b651060c81fa92a9ecad562f6.tar.gz |
Rename --timeout global option and make it work
The --timeout option doesn't work for standalone use-cases when
you specify no-client-auth, and it's also confusing since it's
easily misinterpreted as an option related to the heat timeouts
provided to stack-create and in future stack-update.
So take this opportunity to rename the option to --api-timeout,
which hopefully more accurately reflects it's purpose, and don't
pass a default (just let requests use the global default socket
timeout) as it seems relatively unlikely users will wait for 10
minutes before pressing Ctrl-C on interactive shell requests.
Change-Id: I52480f0d128735bf5f312fc88f4078f27717baf2
Partial-Bug: #1290456
Diffstat (limited to 'heatclient/shell.py')
-rw-r--r-- | heatclient/shell.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/heatclient/shell.py b/heatclient/shell.py index b1ee0a9..1ab0073 100644 --- a/heatclient/shell.py +++ b/heatclient/shell.py @@ -88,9 +88,10 @@ class HeatShell(object): ' option the client looks' ' for the default system CA certificates.') - parser.add_argument('--timeout', - default=600, - help='Number of seconds to wait for a response.') + parser.add_argument('--api-timeout', + help='Number of seconds to wait for an ' + 'API response, ' + 'defaults to system socket timeout') parser.add_argument('--os-username', default=utils.env('OS_USERNAME'), @@ -364,7 +365,6 @@ class HeatShell(object): kwargs = { 'token': token, 'insecure': args.insecure, - 'timeout': args.timeout, 'ca_file': args.ca_file, 'cert_file': args.cert_file, 'key_file': args.key_file, @@ -380,6 +380,9 @@ class HeatShell(object): if not endpoint: endpoint = self._get_endpoint(_ksclient, **kwargs) + if args.api_timeout: + kwargs['timeout'] = args.api_timeout + client = heat_client.Client(api_version, endpoint, **kwargs) args.func(client, args) |