do not make netbox call if lldp doesnt return switch ip and interface #54

Merged
Solvik merged 1 commit from optim_cable_switch into master 2019-09-03 11:57:17 +02:00

View file

@ -307,7 +307,7 @@ class Network():
switch_ip = self.lldp.get_switch_ip(interface.name)
switch_interface = self.lldp.get_switch_port(interface.name)
if switch_ip is not None and switch_interface is not None:
if switch_ip and switch_interface:
nic_update, interface = self.create_or_update_cable(
switch_ip, switch_interface, interface
)
@ -569,6 +569,7 @@ class Network():
if NETWORK_LLDP:
switch_ip = self.lldp.get_switch_ip(interface.name)
switch_interface = self.lldp.get_switch_port(interface.name)
if switch_ip and switch_interface:
ret, interface = self.create_or_update_cable(
switch_ip, switch_interface, interface
)