fix bug while testing debug with an interface not existing while updating
This commit is contained in:
parent
49731644fd
commit
d7af66b325
1 changed files with 5 additions and 0 deletions
|
@ -147,6 +147,11 @@ class Network():
|
||||||
interface = nb.dcim.interfaces.get(
|
interface = nb.dcim.interfaces.get(
|
||||||
mac_address=nic['mac'],
|
mac_address=nic['mac'],
|
||||||
)
|
)
|
||||||
|
if not interface:
|
||||||
|
logging.info('Interface {} not found, creating..'.format(
|
||||||
|
mac_address=nic['mac'])
|
||||||
|
)
|
||||||
|
interface = self.create_netbox_nic(device, nic)
|
||||||
|
|
||||||
nic_update = False
|
nic_update = False
|
||||||
if nic['name'] != interface.name:
|
if nic['name'] != interface.name:
|
||||||
|
|
Loading…
Reference in a new issue