From d6483b92821f645379bea7d8e1524f4345e510ab Mon Sep 17 00:00:00 2001 From: dineshbhor Date: Wed, 21 Feb 2018 12:00:16 +0900 Subject: [PATCH] Fix default value of 'nova_catalog_admin_info' Devstack deploys nova service with name as 'nova' but in masakari.conf 'nova_catalog_admin_info' default is 'compute:Compute Service:publicURL' which causes below error while executing masakari notifications: EndpointNotFound: publicURL endpoint for compute service named Compute Service not found. This patch fixes this issue by changing the default value of config option 'nova_catalog_admin_info' to 'compute:nova:publicURL'. NOTE: In real production deployment of masakari operator has to set the value of this config option according to the nova service name that he/she configures. Closes-Bug: #1746229 Change-Id: I032d85e7e11836a282251885a7f9d4bc76ce7045 --- masakari/conf/nova.py | 2 +- masakari/tests/unit/compute/test_nova.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/masakari/conf/nova.py b/masakari/conf/nova.py index ea8d4077..542f6e01 100644 --- a/masakari/conf/nova.py +++ b/masakari/conf/nova.py @@ -18,7 +18,7 @@ from oslo_config import cfg nova_opts = [ cfg.StrOpt('nova_catalog_admin_info', - default='compute:Compute Service:publicURL', + default='compute:nova:publicURL', help='Match this value when searching for nova in the ' 'service catalog. Format is: separated values of ' 'the form: ' diff --git a/masakari/tests/unit/compute/test_nova.py b/masakari/tests/unit/compute/test_nova.py index 3533c80a..00b4472f 100644 --- a/masakari/tests/unit/compute/test_nova.py +++ b/masakari/tests/unit/compute/test_nova.py @@ -58,7 +58,7 @@ class NovaClientTestCase(test.TestCase): p_api_version(nova.NOVA_API_VERSION), session=p_session.return_value, region_name=None, insecure=False, endpoint_type='publicURL', - service_type='compute', service_name='Compute Service', + service_type='compute', service_name='nova', cacert=None, timeout=None, global_request_id=self.ctx.global_id, extensions=nova.nova_extensions) @@ -78,7 +78,7 @@ class NovaClientTestCase(test.TestCase): p_api_version(nova.NOVA_API_VERSION), session=p_session.return_value, region_name=None, insecure=False, endpoint_type='publicURL', - service_type='compute', service_name='Compute Service', + service_type='compute', service_name='nova', cacert=None, timeout=None, global_request_id=self.ctx.global_id, extensions=nova.nova_extensions) @@ -100,7 +100,7 @@ class NovaClientTestCase(test.TestCase): p_api_version(nova.NOVA_API_VERSION), session=p_session.return_value, region_name=None, insecure=False, endpoint_type='publicURL', - service_type='compute', service_name='Compute Service', + service_type='compute', service_name='nova', cacert=None, timeout=None, global_request_id=self.ctx.global_id, extensions=nova.nova_extensions) @@ -121,7 +121,7 @@ class NovaClientTestCase(test.TestCase): p_api_version(nova.NOVA_API_VERSION), session=p_session.return_value, region_name='farfaraway', insecure=False, endpoint_type='publicURL', - service_type='compute', service_name='Compute Service', + service_type='compute', service_name='nova', cacert=None, timeout=None, global_request_id=self.ctx.global_id, extensions=nova.nova_extensions)