Merge "Use the overcloud host-config before than the one from the global host-config"

This commit is contained in:
Zuul 2020-09-28 15:28:17 +00:00 committed by Gerrit Code Review
commit 4895f6dd00
2 changed files with 12 additions and 7 deletions

View File

@ -456,17 +456,17 @@ class SSHClientManager(object):
if isinstance(host, netaddr.IPAddress): if isinstance(host, netaddr.IPAddress):
host = str(host) host = str(host)
if host_config:
hostname = hostname or host_config.hostname
port = port or host_config.port
username = username or host_config.username
global_host_config = _config.ssh_host_config(host=host, global_host_config = _config.ssh_host_config(host=host,
config_files=config_files) config_files=config_files)
hostname = hostname or global_host_config.hostname hostname = hostname or global_host_config.hostname
port = port or global_host_config.port port = port or global_host_config.port
username = username or global_host_config.username username = username or global_host_config.username
if host_config:
hostname = hostname or host_config.hostname
port = port or host_config.port
username = username or host_config.username
host_key = hostname, port, username, proxy_jump host_key = hostname, port, username, proxy_jump
client = self.clients.get(host_key, UNDEFINED_CLIENT) client = self.clients.get(host_key, UNDEFINED_CLIENT)
if client is UNDEFINED_CLIENT: if client is UNDEFINED_CLIENT:

View File

@ -87,8 +87,13 @@ def overcloud_node_ip_address(ip_version=None, network_name=None, server=None,
server = server or find_overcloud_node(**params) server = server or find_overcloud_node(**params)
ip_version = ip_version or CONF.tobiko.tripleo.overcloud_ip_version ip_version = ip_version or CONF.tobiko.tripleo.overcloud_ip_version
network_name = network_name or CONF.tobiko.tripleo.overcloud_network_name network_name = network_name or CONF.tobiko.tripleo.overcloud_network_name
return nova.find_server_ip_address(server=server, ip_version=ip_version, address = nova.find_server_ip_address(server=server,
network_name=network_name) ip_version=ip_version,
network_name=network_name)
LOG.debug(f"Got Overcloud node address '{address}' from Undercloud "
f"(ip_version={ip_version}, network_name={network_name}, "
f"server={server})")
return address
class OvercloudSshKeyFileFixture(tobiko.SharedFixture): class OvercloudSshKeyFileFixture(tobiko.SharedFixture):