From 536ebe20547c5f69255c698a1d1da9ea26d9bcac Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 25 Jan 2017 19:03:49 +0100 Subject: [PATCH] shell: do not force domain to be present If OS_PROJECT_NAME and Keystone v2 is used there's no need to set a domain. Change-Id: I9555b571224262b61255f70a30f540a32b8ae2fc --- ceilometerclient/shell.py | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/ceilometerclient/shell.py b/ceilometerclient/shell.py index f98804ca..0b3002c2 100644 --- a/ceilometerclient/shell.py +++ b/ceilometerclient/shell.py @@ -181,15 +181,6 @@ class CeilometerShell(object): # Return parsed args return api_version, subcommand_parser.parse_args(argv) - @staticmethod - def no_project_and_domain_set(args): - if not (args.os_project_id or (args.os_project_name and - (args.os_user_domain_name or args.os_user_domain_id)) or - (args.os_tenant_id or args.os_tenant_name)): - return True - else: - return False - def main(self, argv): parsed = self.parse_args(argv) if parsed == 0: @@ -217,17 +208,12 @@ class CeilometerShell(object): "either --os-password or via " "env[OS_PASSWORD]") - if self.no_project_and_domain_set(args): + if not (args.os_project_id or args.os_project_name + or args.os_tenant_id or args.os_tenant_name): # steer users towards Keystone V3 API - raise exc.CommandError("You must provide a project_id via " - "either --os-project-id or via " - "env[OS_PROJECT_ID] and " - "a domain_name via either " - "--os-user-domain-name or via " - "env[OS_USER_DOMAIN_NAME] or " - "a domain_id via either " - "--os-user-domain-id or via " - "env[OS_USER_DOMAIN_ID]") + raise exc.CommandError("You must provide a project_id " + "(or name) via either --os-project-id " + "or via env[OS_PROJECT_ID]") if not self.auth_plugin.opts['auth_url']: raise exc.CommandError("You must provide an auth url via "