Merge "Stop inventory constantly giving containers new IP"
This commit is contained in:
@@ -514,10 +514,10 @@ def network_entry(is_metal, interface,
|
|||||||
# simplified. The container address checking that is ssh address
|
# simplified. The container address checking that is ssh address
|
||||||
# is only being done to support old inventory.
|
# is only being done to support old inventory.
|
||||||
|
|
||||||
if is_metal:
|
|
||||||
_network = dict()
|
_network = dict()
|
||||||
else:
|
|
||||||
_network = {'interface': interface}
|
if not is_metal:
|
||||||
|
_network['interface'] = interface
|
||||||
|
|
||||||
if bridge:
|
if bridge:
|
||||||
_network['bridge'] = bridge
|
_network['bridge'] = bridge
|
||||||
@@ -622,10 +622,15 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface,
|
|||||||
net_type,
|
net_type,
|
||||||
net_mtu
|
net_mtu
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# update values from _network in case they have changed
|
||||||
|
if old_address in networks:
|
||||||
|
for key in _network.keys():
|
||||||
|
networks[old_address][key] = _network[key]
|
||||||
|
|
||||||
# This should convert found addresses based on q_name + "_address"
|
# This should convert found addresses based on q_name + "_address"
|
||||||
# and then build the network if its not found.
|
# and then build the network if its not found.
|
||||||
if not is_metal and (old_address not in networks or
|
if not is_metal and old_address not in networks:
|
||||||
networks[old_address] != _network):
|
|
||||||
network = networks[old_address] = _network
|
network = networks[old_address] = _network
|
||||||
if old_address in container and container[old_address]:
|
if old_address in container and container[old_address]:
|
||||||
network['address'] = container.pop(old_address)
|
network['address'] = container.pop(old_address)
|
||||||
|
Reference in New Issue
Block a user