make sure every interface attribute is ok
This commit is contained in:
parent
1988bd0f9c
commit
ab660b4fcf
1 changed files with 18 additions and 1 deletions
|
|
@ -224,6 +224,23 @@ class Network():
|
||||||
interface=interface, name=nic['name']))
|
interface=interface, name=nic['name']))
|
||||||
interface.name = nic['name']
|
interface.name = nic['name']
|
||||||
|
|
||||||
|
if nic['vlan'] is None and interface.mode is not None:
|
||||||
|
logging.info('Interface is not tagged, reseting mode')
|
||||||
|
nic_update = True
|
||||||
|
interface.mode = None
|
||||||
|
|
||||||
|
type = self.get_netbox_type_for_nic(nic)
|
||||||
|
if type != interface.type.value:
|
||||||
|
logging.info('Interface type is wrong, resetting')
|
||||||
|
nic_update = True
|
||||||
|
interface.type = type
|
||||||
|
|
||||||
|
if interface.lag is not None:
|
||||||
|
if nic['name'] not in self.nics[interface.lag.name]['bonding_slaves']:
|
||||||
|
logging.info('Interface has no LAG, resetting')
|
||||||
|
nic_update = True
|
||||||
|
interface.lag = None
|
||||||
|
|
||||||
if nic['ip']:
|
if nic['ip']:
|
||||||
# sync local IPs
|
# sync local IPs
|
||||||
for ip in nic['ip']:
|
for ip in nic['ip']:
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue