Merge "Add TypeError exception when parsing addresses" into stable/wallaby

This commit is contained in:
Zuul 2022-04-26 23:17:05 +00:00 committed by Gerrit Code Review
commit f6181ad8b6
2 changed files with 6 additions and 3 deletions

View File

@ -23,5 +23,5 @@ def bracket_ipv6(address):
try:
socket.inet_pton(socket.AF_INET6, address)
return "[%s]" % address
except socket.error:
except (socket.error, TypeError):
return address

View File

@ -90,8 +90,11 @@ def _create_overcloudrc_from_outputs(
host = urllib.parse.urlparse(endpoint).hostname
no_proxy_list = no_proxy.split(',')
no_proxy_list = map(common_utils.bracket_ipv6,
no_proxy_list + [host, admin_vip])
no_proxy_list.extend([host, admin_vip])
no_proxy_list = map(
common_utils.bracket_ipv6,
[i for i in no_proxy_list if i]
)
# Remove duplicated entries
no_proxy_list = sorted(list(set(no_proxy_list)))