diff --git a/netbox_agent/lldp.py b/netbox_agent/lldp.py index 0f0b794..51083f5 100644 --- a/netbox_agent/lldp.py +++ b/netbox_agent/lldp.py @@ -1,7 +1,5 @@ import logging import subprocess -import logging -from netbox_agent.misc import is_tool from netbox_agent.misc import is_tool diff --git a/netbox_agent/server.py b/netbox_agent/server.py index 6e36d8e..22c2e3b 100644 --- a/netbox_agent/server.py +++ b/netbox_agent/server.py @@ -81,7 +81,8 @@ class ServerBase(): if ( rack - and all(map(lambda x: x is not None and "id" in x, (nb_rack, server.rack))) + and server.rack + and nb_rack and server.rack.id != nb_rack.id ): logging.info('Rack location has changed from {} to {}, updating'.format(