diff --git a/monikerclient/cli/base.py b/monikerclient/cli/base.py index 8ab1a457..e4c88072 100644 --- a/monikerclient/cli/base.py +++ b/monikerclient/cli/base.py @@ -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) diff --git a/monikerclient/v1/__init__.py b/monikerclient/v1/__init__.py index 7eba9b67..4c52804c 100644 --- a/monikerclient/v1/__init__.py +++ b/monikerclient/v1/__init__.py @@ -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'}