diff --git a/osa_toolkit/generate.py b/osa_toolkit/generate.py index c99fa234db..df40e99ead 100755 --- a/osa_toolkit/generate.py +++ b/osa_toolkit/generate.py @@ -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