From f99be3bf3661e8af6ebf950398ed35420f237fbc Mon Sep 17 00:00:00 2001 From: Dolph Mathews Date: Wed, 7 Nov 2012 23:32:46 -0600 Subject: [PATCH] Check for auth URL before password (bug 1076235) Change-Id: I9cebbf199e8cf3d9dd7de532b30da9f732a6dab1 --- keystoneclient/shell.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/keystoneclient/shell.py b/keystoneclient/shell.py index 56e8a9229..963a9968d 100644 --- a/keystoneclient/shell.py +++ b/keystoneclient/shell.py @@ -300,6 +300,11 @@ class OpenStackIdentityShell(object): 'Expecting a username provided via either ' '--os-username or env[OS_USERNAME]') + if not args.os_auth_url: + raise exc.CommandError( + 'Expecting an auth URL via either --os-auth-url or ' + 'env[OS_AUTH_URL]') + if not args.os_password: # No password, If we've got a tty, try prompting for it if hasattr(sys.stdin, 'isatty') and sys.stdin.isatty(): @@ -316,11 +321,6 @@ class OpenStackIdentityShell(object): '--os-password, env[OS_PASSWORD], or ' 'prompted response') - if not args.os_auth_url: - raise exc.CommandError( - '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 (