diff options
author | You Yamagata <bi.yamagata@gmail.com> | 2013-01-10 12:59:57 +0900 |
---|---|---|
committer | You Yamagata <bi.yamagata@gmail.com> | 2013-01-10 13:26:53 +0900 |
commit | 5edb40b44227a8a615a95bd565dd92ffbb3165c0 (patch) | |
tree | 86b862dbc872c520bc68ddd272e4018e715e4862 /bin | |
parent | e93d47a930f6079547c668070665a85f731d332f (diff) | |
download | python-swiftclient-5edb40b44227a8a615a95bd565dd92ffbb3165c0.tar.gz |
Add env[SWIFTCLIENT_INSECURE]
Add env[SWIFTCLIENT_INSECURE] as default of --insecure option.
If set to 'true', allow to access insecure keystone server.
The name follows 'NOVACLIENT_INSECURE' in novaclient.
Change-Id: I322674eba9c07e6def97bce339815fa15191a92d
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/swift | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -29,7 +29,7 @@ from time import sleep, time from traceback import format_exception from urllib import quote, unquote -from swiftclient import Connection, ClientException, HTTPException +from swiftclient import Connection, ClientException, HTTPException, utils def get_conn(options): @@ -1151,11 +1151,16 @@ Example: help='Specify a CA bundle file to use in verifying a ' 'TLS (https) server certificate. ' 'Defaults to env[OS_CACERT]') + default_val = utils.config_true_value( + environ.get('SWIFTCLIENT_INSECURE')) parser.add_option('--insecure', - action="store_true", dest="insecure", default=False, + action="store_true", dest="insecure", + default=default_val, help='Allow swiftclient to access insecure keystone ' 'server. The keystone\'s certificate will not ' - 'be verified.') + 'be verified. ' + 'Defaults to env[SWIFTCLIENT_INSECURE] ' + '(set to \'true\' to enable).') parser.disable_interspersed_args() (options, args) = parse_args(parser, argv[1:], enforce_requires=False) parser.enable_interspersed_args() |