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 (