summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKengo Takahara <takahara-kn@njk.co.jp>2017-10-19 16:41:33 +0900
committerKengo Takahara <takahara-kn@njk.co.jp>2017-10-19 16:45:57 +0900
commit99dd18d053dd0b06b959eae63b25f423ad9df19b (patch)
tree380c4cdb3c060539762dd4af34f5bc205705a091
parent7ef4e969494085b7c336a82e252b0337b6dd3d3c (diff)
Use service_type and service_name of nova_catalog_admin_info
Masakari has never used service_type and service_name of nova_catalog_admin_info. However, these can be specified when masakari creates a novalient object. This patch modified so that masakari uses these. Change-Id: I7fdd3b47230bea004a9129234c88d20d611814bf Closes-Bug: #1724764
Notes
Notes (review): Code-Review+2: Rikimaru Honjo <honjo.rikimaru@po.ntt-tx.co.jp> Code-Review+1: Li Yingjun <yingjun.li@kylin-cloud.com> Code-Review+1: Hieu LE <hieulq@vn.fujitsu.com> Workflow+1: Sampath Priyankara (samP) <sam47priya@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 14 Nov 2017 07:28:50 +0000 Reviewed-on: https://review.openstack.org/513299 Project: openstack/masakari Branch: refs/heads/master
-rw-r--r--masakari/compute/nova.py2
-rw-r--r--masakari/tests/unit/compute/test_nova.py20
2 files changed, 14 insertions, 8 deletions
diff --git a/masakari/compute/nova.py b/masakari/compute/nova.py
index b9836eb..ee18ef0 100644
--- a/masakari/compute/nova.py
+++ b/masakari/compute/nova.py
@@ -124,6 +124,8 @@ def novaclient(context, timeout=None):
124 global_request_id=context.global_id, 124 global_request_id=context.global_id,
125 region_name=CONF.os_region_name, 125 region_name=CONF.os_region_name,
126 endpoint_type=endpoint_type, 126 endpoint_type=endpoint_type,
127 service_type=service_type,
128 service_name=service_name,
127 cacert=CONF.nova_ca_certificates_file, 129 cacert=CONF.nova_ca_certificates_file,
128 extensions=nova_extensions) 130 extensions=nova_extensions)
129 131
diff --git a/masakari/tests/unit/compute/test_nova.py b/masakari/tests/unit/compute/test_nova.py
index 04fca4b..3533c80 100644
--- a/masakari/tests/unit/compute/test_nova.py
+++ b/masakari/tests/unit/compute/test_nova.py
@@ -57,8 +57,9 @@ class NovaClientTestCase(test.TestCase):
57 p_client.assert_called_once_with( 57 p_client.assert_called_once_with(
58 p_api_version(nova.NOVA_API_VERSION), 58 p_api_version(nova.NOVA_API_VERSION),
59 session=p_session.return_value, region_name=None, 59 session=p_session.return_value, region_name=None,
60 insecure=False, endpoint_type='publicURL', cacert=None, 60 insecure=False, endpoint_type='publicURL',
61 timeout=None, global_request_id=self.ctx.global_id, 61 service_type='compute', service_name='Compute Service',
62 cacert=None, timeout=None, global_request_id=self.ctx.global_id,
62 extensions=nova.nova_extensions) 63 extensions=nova.nova_extensions)
63 64
64 @mock.patch('novaclient.api_versions.APIVersion') 65 @mock.patch('novaclient.api_versions.APIVersion')
@@ -76,8 +77,9 @@ class NovaClientTestCase(test.TestCase):
76 p_client.assert_called_once_with( 77 p_client.assert_called_once_with(
77 p_api_version(nova.NOVA_API_VERSION), 78 p_api_version(nova.NOVA_API_VERSION),
78 session=p_session.return_value, region_name=None, 79 session=p_session.return_value, region_name=None,
79 insecure=False, endpoint_type='publicURL', cacert=None, 80 insecure=False, endpoint_type='publicURL',
80 timeout=None, global_request_id=self.ctx.global_id, 81 service_type='compute', service_name='Compute Service',
82 cacert=None, timeout=None, global_request_id=self.ctx.global_id,
81 extensions=nova.nova_extensions) 83 extensions=nova.nova_extensions)
82 84
83 @mock.patch('novaclient.api_versions.APIVersion') 85 @mock.patch('novaclient.api_versions.APIVersion')
@@ -97,8 +99,9 @@ class NovaClientTestCase(test.TestCase):
97 p_client.assert_called_once_with( 99 p_client.assert_called_once_with(
98 p_api_version(nova.NOVA_API_VERSION), 100 p_api_version(nova.NOVA_API_VERSION),
99 session=p_session.return_value, region_name=None, 101 session=p_session.return_value, region_name=None,
100 insecure=False, endpoint_type='publicURL', cacert=None, 102 insecure=False, endpoint_type='publicURL',
101 timeout=None, global_request_id=self.ctx.global_id, 103 service_type='compute', service_name='Compute Service',
104 cacert=None, timeout=None, global_request_id=self.ctx.global_id,
102 extensions=nova.nova_extensions) 105 extensions=nova.nova_extensions)
103 106
104 @mock.patch('novaclient.api_versions.APIVersion') 107 @mock.patch('novaclient.api_versions.APIVersion')
@@ -117,8 +120,9 @@ class NovaClientTestCase(test.TestCase):
117 p_client.assert_called_once_with( 120 p_client.assert_called_once_with(
118 p_api_version(nova.NOVA_API_VERSION), 121 p_api_version(nova.NOVA_API_VERSION),
119 session=p_session.return_value, region_name='farfaraway', 122 session=p_session.return_value, region_name='farfaraway',
120 insecure=False, endpoint_type='publicURL', cacert=None, 123 insecure=False, endpoint_type='publicURL',
121 timeout=None, global_request_id=self.ctx.global_id, 124 service_type='compute', service_name='Compute Service',
125 cacert=None, timeout=None, global_request_id=self.ctx.global_id,
122 extensions=nova.nova_extensions) 126 extensions=nova.nova_extensions)
123 127
124 128