Check for auth URL before password (bug 1076235)

Change-Id: I9cebbf199e8cf3d9dd7de532b30da9f732a6dab1
This commit is contained in:
Dolph Mathews
2012-11-07 23:32:46 -06:00
parent 8508b3e859
commit f99be3bf36

View File

@@ -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 (