summaryrefslogtreecommitdiff
path: root/keystoneclient/shell.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-11-16 17:29:05 +0000
committerGerrit Code Review <review@openstack.org>2012-11-16 17:29:05 +0000
commit677ff3c5205a573ed032a55a68e63cbdceb2b9bd (patch)
tree74a02606f23a028b88288cd7f68b8104022a5b71 /keystoneclient/shell.py
parent332a13396d1e33d51dccaafe40b510a8db62e677 (diff)
parent8508b3e859af5806dc87af6a90b35877eb3c12ff (diff)
downloadpython-keystoneclient-677ff3c5205a573ed032a55a68e63cbdceb2b9bd.tar.gz
Merge "check creds before token/endpoint (bug 1076233)"
Diffstat (limited to 'keystoneclient/shell.py')
-rw-r--r--keystoneclient/shell.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/keystoneclient/shell.py b/keystoneclient/shell.py
index 7a3b604..c72555d 100644
--- a/keystoneclient/shell.py
+++ b/keystoneclient/shell.py
@@ -299,20 +299,6 @@ class OpenStackIdentityShell(object):
'ignored).')
print msg
- # if it looks like the user wants to provide a service token
- # but is missing something
- if args.os_token or args.os_endpoint and not (
- args.os_token and args.os_endpoint):
- if not args.os_token:
- raise exc.CommandError(
- 'Expecting a token provided via either --os-token or '
- 'env[OS_SERVICE_TOKEN]')
-
- if not args.os_endpoint:
- raise exc.CommandError(
- 'Expecting an endpoint provided via either '
- '--os-endpoint or env[OS_SERVICE_ENDPOINT]')
-
# if it looks like the user wants to provide a credentials
# but is missing something
if (not (args.os_token and args.os_endpoint)
@@ -345,6 +331,20 @@ class OpenStackIdentityShell(object):
'Expecting an auth URL via either --os-auth-url or '
'env[OS_AUTH_URL]')
+ # if it looks like the user wants to provide a service token
+ # but is missing something
+ if args.os_token or args.os_endpoint and not (
+ args.os_token and args.os_endpoint):
+ if not args.os_token:
+ raise exc.CommandError(
+ 'Expecting a token provided via either --os-token or '
+ 'env[OS_SERVICE_TOKEN]')
+
+ if not args.os_endpoint:
+ raise exc.CommandError(
+ 'Expecting an endpoint provided via either '
+ '--os-endpoint or env[OS_SERVICE_ENDPOINT]')
+
if utils.isunauthenticated(args.func):
self.cs = shell_generic.CLIENT_CLASS(endpoint=args.os_auth_url,
cacert=args.os_cacert,