diff --git a/aodh/evaluator/threshold.py b/aodh/evaluator/threshold.py index e281c55e..d3aab584 100644 --- a/aodh/evaluator/threshold.py +++ b/aodh/evaluator/threshold.py @@ -66,6 +66,9 @@ class ThresholdEvaluator(evaluator.Evaluator): os_endpoint_type=auth_config.os_endpoint_type, insecure=auth_config.insecure, timeout=cfg.CONF.http_timeout, + os_user_domain_id=auth_config.os_user_domain_id, + os_project_name=auth_config.os_project_name, + os_project_domain_id=auth_config.os_project_domain_id, ) self.api_client = ceiloclient.get_client(2, **creds) return self.api_client diff --git a/aodh/service.py b/aodh/service.py index 1c11e877..b338f764 100644 --- a/aodh/service.py +++ b/aodh/service.py @@ -89,6 +89,15 @@ CLI_OPTS = [ default=False, help='Disables X.509 certificate validation when an ' 'SSL connection to Identity Service is established.'), + cfg.StrOpt('os-user-domain-id', + default=os.environ.get('OS_USER_DOMAIN_ID', 'default'), + help='The domain id of the user'), + cfg.StrOpt('os-project-domain-id', + default=os.environ.get('OS_PROJECT_DOMAIN_ID', 'default'), + help='The domain id of the user project'), + cfg.StrOpt('os-project-name', + default=os.environ.get('OS_PROJECT_NAME', 'admin'), + help='The user project name'), ] cfg.CONF.register_cli_opts(CLI_OPTS, group="service_credentials") diff --git a/aodh/tests/evaluator/test_threshold.py b/aodh/tests/evaluator/test_threshold.py index 7843e7a2..f2a651cb 100644 --- a/aodh/tests/evaluator/test_threshold.py +++ b/aodh/tests/evaluator/test_threshold.py @@ -421,16 +421,20 @@ class TestEvaluate(base.TestEvaluatorBase): self.evaluator.api_client = None self._evaluate_all_alarms() conf = self.conf.service_credentials - expected = [mock.call(2, - os_auth_url=conf.os_auth_url, - os_region_name=conf.os_region_name, - os_tenant_name=conf.os_tenant_name, - os_password=conf.os_password, - os_username=conf.os_username, - os_cacert=conf.os_cacert, - os_endpoint_type=conf.os_endpoint_type, - timeout=self.conf.http_timeout, - insecure=conf.insecure)] + expected = [mock.call( + 2, + os_auth_url=conf.os_auth_url, + os_region_name=conf.os_region_name, + os_tenant_name=conf.os_tenant_name, + os_password=conf.os_password, + os_username=conf.os_username, + os_cacert=conf.os_cacert, + os_endpoint_type=conf.os_endpoint_type, + timeout=self.conf.http_timeout, + insecure=conf.insecure, + os_user_domain_id=conf.os_user_domain_id, + os_project_name=conf.os_project_name, + os_project_domain_id=conf.os_project_domain_id)] actual = client.call_args_list self.assertEqual(expected, actual)