Update netbox_agent/server.py

Co-authored-by: Guillaume Gelin <contact@ramnes.eu>
This commit is contained in:
Cyrinux 2021-07-09 11:22:31 +02:00 committed by Your Name
parent bac3350023
commit 225286ed46
No known key found for this signature in database
GPG key ID: 8538D68543979A20
2 changed files with 2 additions and 3 deletions

View file

@ -1,7 +1,5 @@
import logging
import subprocess
import logging
from netbox_agent.misc import is_tool
from netbox_agent.misc import is_tool

View file

@ -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(