From d0e5cad7f305e9cdcd7c41a168a89847a08d98d6 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Tue, 26 May 2015 13:28:28 +1200 Subject: [PATCH] Run functional tests when no ceilometer endpoint Currently if there is no metering endpoint in the service catalog then no functional/integration tests can be done. This change tolerates missing ceilometer endpoint. Change-Id: I55d45048284c4e78b9a1a94a35ef3cddc7bc3a37 --- heat_integrationtests/common/clients.py | 38 ++++++++++++++----------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/heat_integrationtests/common/clients.py b/heat_integrationtests/common/clients.py index 6042456fe..c7a7f60e6 100644 --- a/heat_integrationtests/common/clients.py +++ b/heat_integrationtests/common/clients.py @@ -144,22 +144,26 @@ class ClientManager(object): dscv = self.conf.disable_ssl_certificate_validation keystone = self._get_identity_client() - endpoint = keystone.service_catalog.url_for( - attr='region', - filter_value=self.conf.region, - service_type='metering', - endpoint_type='publicURL') + try: + endpoint = keystone.service_catalog.url_for( + attr='region', + filter_value=self.conf.region, + service_type='metering', + endpoint_type='publicURL') - args = { - 'username': self.conf.username, - 'password': self.conf.password, - 'tenant_name': self.conf.tenant_name, - 'auth_url': self.conf.auth_url, - 'insecure': dscv, - 'region_name': self.conf.region, - 'endpoint_type': 'publicURL', - 'service_type': 'metering', - } + except keystoneclient.exceptions.EndpointNotFound: + return None + else: + args = { + 'username': self.conf.username, + 'password': self.conf.password, + 'tenant_name': self.conf.tenant_name, + 'auth_url': self.conf.auth_url, + 'insecure': dscv, + 'region_name': self.conf.region, + 'endpoint_type': 'publicURL', + 'service_type': 'metering', + } - return ceilometerclient.client.Client(self.CEILOMETER_VERSION, - endpoint, **args) + return ceilometerclient.client.Client(self.CEILOMETER_VERSION, + endpoint, **args)