Explicitly set IP=0.0.0.0 on interfaces with no IP address

This will remove any existing IP address from the interface.
This commit is contained in:
Mark Goddard 2017-08-22 14:06:51 +00:00
parent 112e36a7fd
commit b24db07b35

View File

@ -171,6 +171,8 @@ def net_interface_obj(context, name, inventory_hostname=None):
"Network interface for network '%s' on host '%s' not found" %
(name, inventory_hostname))
ip = net_ip(context, name, inventory_hostname)
if ip is None:
ip = '0.0.0.0'
cidr = net_cidr(context, name, inventory_hostname)
netmask = net_mask(context, name, inventory_hostname)
gateway = net_gateway(context, name, inventory_hostname)
@ -207,6 +209,8 @@ def net_bridge_obj(context, name, inventory_hostname=None):
"Network interface for network '%s' on host '%s' not found" %
(name, inventory_hostname))
ip = net_ip(context, name, inventory_hostname)
if ip is None:
ip = '0.0.0.0'
cidr = net_cidr(context, name, inventory_hostname)
netmask = net_mask(context, name, inventory_hostname)
gateway = net_gateway(context, name, inventory_hostname)
@ -245,6 +249,8 @@ def net_bond_obj(context, name, inventory_hostname=None):
"Network interface for network '%s' on host '%s' not found" %
(name, inventory_hostname))
ip = net_ip(context, name, inventory_hostname)
if ip is None:
ip = '0.0.0.0'
cidr = net_cidr(context, name, inventory_hostname)
netmask = net_mask(context, name, inventory_hostname)
gateway = net_gateway(context, name, inventory_hostname)