Refactor creation of no_proxy list for postconfig

Adds keystone admin ip to the list, create the list more closely
to what utils already does.

Change-Id: I6937bf0e46867b71972a322d33c0ac68e226b079
Closes-Bug: 1634823
This commit is contained in:
Gabriele Cerami 2016-10-27 15:51:08 +02:00 committed by Ben Nemec
parent 06f7b3a00e
commit 0b2cf71a84
1 changed files with 6 additions and 2 deletions

View File

@ -664,9 +664,13 @@ class DeployOvercloud(command.Command):
overcloud_ip_or_fqdn = six.moves.urllib.parse.urlparse(
overcloud_endpoint).hostname
no_proxy = [os.environ.get('no_proxy'), overcloud_ip_or_fqdn]
keystone_admin_ip = utils.get_endpoint('KeystoneAdmin', stack)
no_proxy = os.environ.get('no_proxy', overcloud_ip_or_fqdn)
no_proxy_list = map(utils.bracket_ipv6,
[no_proxy, overcloud_ip_or_fqdn,
keystone_admin_ip])
os.environ['no_proxy'] = ','.join(
[x for x in no_proxy if x is not None])
[x for x in no_proxy_list if x is not None])
utils.remove_known_hosts(overcloud_ip_or_fqdn)