Use configured endpoint instead of hardcoded ones

Usage of public endpoints was hardcoded
- for the Heat client
- in a test for the Zaqar client
- when checking if a service is available

A test also required Heat to be configured to use public endpoints when
talking to services. This test is more relaxed now.

Change-Id: I3784e126d28a51d990702e1b9e6bf23f0447fa21
This commit is contained in:
Matthias Bastian 2018-07-12 12:16:30 +02:00
parent 9ca1fc2c55
commit 092d8bdae5
4 changed files with 6 additions and 5 deletions

View File

@ -257,7 +257,7 @@ class HeatIntegrationTest(testtools.testcase.WithAttributes,
def is_service_available(self, service_type):
try:
self.identity_client.get_endpoint_url(
service_type, self.conf.region)
service_type, self.conf.region, self.conf.endpoint_type)
except kc_exceptions.EndpointNotFound:
return False
else:

View File

@ -111,7 +111,7 @@ class ClientManager(object):
self.HEATCLIENT_VERSION,
endpoint,
session=session,
endpoint_type='publicURL',
endpoint_type=self.conf.endpoint_type,
service_type='orchestration',
region_name=self.conf.region,
username=self._username(),

View File

@ -94,9 +94,10 @@ outputs:
ex = self.assertRaises(exc.HTTPBadRequest, self.stack_create, **kwargs)
error_msg = ('ERROR: Cannot establish connection to Heat endpoint '
'at region "DARKHOLE" due to "publicURL endpoint for '
'at region "DARKHOLE" due to '
'"(?:public|internal|admin)(?:URL)? endpoint for '
'orchestration service in DARKHOLE region not found"')
self.assertEqual(error_msg, six.text_type(ex))
self.assertRegex(six.text_type(ex), error_msg)
@decorators.idempotent_id('b2190dfc-d223-4595-b168-6c42b0f3a3e5')
def test_stack_resource_validation_fail(self):

View File

@ -54,7 +54,7 @@ outputs:
password=signal['password'],
project_id=signal['project_id'])
endpoint = ks.service_catalog.url_for(
service_type='messaging', endpoint_type='publicURL')
service_type='messaging', endpoint_type=self.conf.endpoint_type)
conf = {
'auth_opts': {
'backend': 'keystone',