DC: config registry_host with correct IPv6 format

In the subcloud of an IPv6 Distributed Cloud system, the IP address of
registry_host in glance-api.conf has wrongly been put in [] (eg,
[fe01:1::2]), causing glance-api failure when tries to connect to
registry. This update fixed this issue by not formatting the IPv6
address into [] during puppet manifest hieradata generation.

Story: 2002988
Task: 23002

Change-Id: I09ccfe1f4887bcf02301497404751f023385fd1c
Signed-off-by: Andy Ning <andy.ning@windriver.com>
This commit is contained in:
Andy Ning 2018-07-08 19:43:13 -04:00
parent 4340414bb5
commit f3c6c12c84
2 changed files with 5 additions and 5 deletions

View File

@ -111,7 +111,7 @@ class GlancePuppet(openstack.OpenstackBasePuppet):
# update remote registry for subcloud
if (self._distributed_cloud_role() ==
constants.DISTRIBUTED_CLOUD_ROLE_SUBCLOUD):
registry_host = self._get_system_controller_host()
registry_host = self._get_system_controller_addr()
remote_registry_region_name = constants.SYSTEM_CONTROLLER_REGION
if constants.GLANCE_BACKEND_RBD in enabled_backends:
@ -205,7 +205,7 @@ class GlancePuppet(openstack.OpenstackBasePuppet):
# to have that information in sub cloud config file eventually.
# For now it's assumed it's on http and on port 5000
api_auth_url = self._format_url_address(
self._get_system_controller_host())
self._get_system_controller_addr())
api_auth_url = 'http://' + api_auth_url + ':5000/v3'
config.update({

View File

@ -189,14 +189,14 @@ class OpenstackBasePuppet(base.BasePuppet):
def _get_service_project_domain_name(self):
return self._operator.keystone.get_service_project_domain()
def _get_system_controller_host(self):
# Get SystemController's address of DistributedCloud.
def _get_system_controller_addr(self):
sys_controller_network = self.dbapi.network_get_by_type(
constants.NETWORK_TYPE_SYSTEM_CONTROLLER)
sys_controller_network_addr_pool = self.dbapi.address_pool_get(
sys_controller_network.pool_uuid)
addr = sys_controller_network_addr_pool.floating_address
host = self._format_url_address(addr)
return host
return addr
@staticmethod
def _format_keystone_endpoint(protocol, port, address, path):