Provide a sane error message when --os-auth-url or --os-endpoint have not been supplied.

Change-Id: I930ea853cec00db87c87115ab3e3a94b7fe3c703
This commit is contained in:
Kiall Mac Innes 2012-12-11 16:41:50 -08:00
parent f99f313672
commit d21546beca
2 changed files with 5 additions and 1 deletions
monikerclient

@ -36,6 +36,10 @@ class Command(CliffCommand):
'region_name': self.app.options.os_region_name,
}
if client_args['endpoint'] is None and client_args['auth_url'] is None:
raise ValueError('Either the --os-endpoint or --os-auth-url '
'argument must be supplied')
self.client = Client(**client_args)
return super(Command, self).run(parsed_args)

@ -46,7 +46,7 @@ class Client(object):
elif endpoint:
auth = None
else:
raise ValueError('Either an auth_url or endpoint must be supplied')
raise ValueError('Either an endpoint or auth_url must be supplied')
headers = {'Content-Type': 'application/json'}