summaryrefslogtreecommitdiff
path: root/keystoneclient/shell.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-11-16 03:36:09 +0000
committerGerrit Code Review <review@openstack.org>2012-11-16 03:36:09 +0000
commitb145d2294a06734cb32a2ae8977ed04e9c9f692e (patch)
tree289bbf540bd6c7ba5fcc8a00b216d9011368bc9a /keystoneclient/shell.py
parentb111637419a68b09fa52b8d7285b2c6160bf9e18 (diff)
parentf9a7d9f3a8eece1c4e46719f3f21e936a065e4b8 (diff)
downloadpython-keystoneclient-b145d2294a06734cb32a2ae8977ed04e9c9f692e.tar.gz
Merge "Warn about bypassing auth on CLI (bug 1076225)"
Diffstat (limited to 'keystoneclient/shell.py')
-rw-r--r--keystoneclient/shell.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/keystoneclient/shell.py b/keystoneclient/shell.py
index 6af39d5..6da6bc4 100644
--- a/keystoneclient/shell.py
+++ b/keystoneclient/shell.py
@@ -275,6 +275,17 @@ class OpenStackIdentityShell(object):
'\n or credentials, '
'--os-username or env[OS_USERNAME].')
+ # user supplied a token and endpoint and at least one other cred
+ if (args.os_token and args.os_endpoint) and (args.os_username or
+ args.os_tenant_id or
+ args.os_tenant_name or
+ args.os_password or
+ args.os_auth_url):
+ msg = ('WARNING: Bypassing authentication using a token & '
+ 'endpoint (authentication credentials are being '
+ '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 (
@@ -291,9 +302,10 @@ class OpenStackIdentityShell(object):
# if it looks like the user wants to provide a credentials
# but is missing something
- if ((args.os_username or args.os_password or args.os_auth_url)
- and not (args.os_username and args.os_password and
- args.os_auth_url)):
+ if (not (args.os_token and args.os_endpoint)
+ and ((args.os_username or args.os_password or args.os_auth_url)
+ and not (args.os_username and args.os_password and
+ args.os_auth_url))):
if not args.os_username:
raise exc.CommandError(
'Expecting a username provided via either '