summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorYou Yamagata <bi.yamagata@gmail.com>2013-01-10 12:59:57 +0900
committerYou Yamagata <bi.yamagata@gmail.com>2013-01-10 13:26:53 +0900
commit5edb40b44227a8a615a95bd565dd92ffbb3165c0 (patch)
tree86b862dbc872c520bc68ddd272e4018e715e4862 /bin
parente93d47a930f6079547c668070665a85f731d332f (diff)
downloadpython-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-xbin/swift11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/swift b/bin/swift
index 7c942f4..21aa3bf 100755
--- a/bin/swift
+++ b/bin/swift
@@ -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()