Merge "Update existing container_networks"

This commit is contained in:
Zuul 2017-12-15 14:33:01 +00:00 committed by Gerrit Code Review
commit 0fa1d218d9

View File

@ -615,16 +615,18 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface,
if properties:
is_metal = properties.get('is_metal', False)
_network = network_entry(
is_metal,
interface,
bridge,
net_type,
net_mtu
)
# This should convert found addresses based on q_name + "_address"
# and then build the network if its not found.
if not is_metal and old_address not in networks:
network = networks[old_address] = network_entry(
is_metal,
interface,
bridge,
net_type,
net_mtu
)
if not is_metal and (old_address not in networks or
networks[old_address] != _network):
network = networks[old_address] = _network
if old_address in container and container[old_address]:
network['address'] = container.pop(old_address)
elif not is_metal:
@ -634,13 +636,7 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface,
network['netmask'] = netmask
elif is_metal:
network = networks[old_address] = network_entry(
is_metal,
interface,
bridge,
net_type,
net_mtu
)
network = networks[old_address] = _network
network['netmask'] = netmask
if is_ssh_address or is_container_address:
# Container physical host group