summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChmouel Boudjnah <chmouel@chmouel.com>2012-05-08 14:05:21 +0100
committerChmouel Boudjnah <chmouel@chmouel.com>2012-05-08 14:06:43 +0100
commit9ee3ee6e6d37328bf5fd5e71b08f7b381e33bc22 (patch)
treefeadb17907d0ca527105b57e5a3a09a90e4b00cf /bin
parentb55acc34f0df54a48665eb3fbc7d9eb024dd7cb2 (diff)
downloadpython-swiftclient-9ee3ee6e6d37328bf5fd5e71b08f7b381e33bc22.tar.gz
Allow specify the tenant in user.
- This is to allow the -U tenant:user syntax like previously supported when not using the os_ arguments.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/swift10
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/swift b/bin/swift
index fea6e9d..354f82c 100755
--- a/bin/swift
+++ b/bin/swift
@@ -937,12 +937,14 @@ def parse_args(parser, args, enforce_requires=True):
if (not (options.auth and options.user and options.key) or
options.os_auth_url):
# Use 2.0 auth if none of the old args are present
- options.auth_version = "2.0"
+ options.auth_version = '2.0'
- if options.auth_version == "2.0" and not options.os_tenant_name and \
- options.os_username and options.os_username.find(':'):
+ if options.auth_version in ('2.0', '2') and not \
+ options.os_tenant_name and options.user and \
+ ':' in options.user:
(options.os_tenant_name,
- options.os_username) = options.os_username.split(':')
+ options.os_username) = options.user.split(':')
+ options.user = options.os_username
# Use new-style args if old ones not present
if not options.auth and options.os_auth_url: