From 225286ed46db8b34127af44b93d8aee54410d379 Mon Sep 17 00:00:00 2001 From: Cyrinux Date: Fri, 9 Jul 2021 11:22:31 +0200 Subject: [PATCH] Update netbox_agent/server.py Co-authored-by: Guillaume Gelin --- netbox_agent/lldp.py | 2 -- netbox_agent/server.py | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) 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(