Provide a sane error message when --os-auth-url or --os-endpoint have not been supplied.
Change-Id: I930ea853cec00db87c87115ab3e3a94b7fe3c703
This commit is contained in:
@@ -36,6 +36,10 @@ class Command(CliffCommand):
|
|||||||
'region_name': self.app.options.os_region_name,
|
'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)
|
self.client = Client(**client_args)
|
||||||
|
|
||||||
return super(Command, self).run(parsed_args)
|
return super(Command, self).run(parsed_args)
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class Client(object):
|
|||||||
elif endpoint:
|
elif endpoint:
|
||||||
auth = None
|
auth = None
|
||||||
else:
|
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'}
|
headers = {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user