Update netbox_agent/server.py
Co-authored-by: Guillaume Gelin <contact@ramnes.eu>
This commit is contained in:
parent
bac3350023
commit
225286ed46
2 changed files with 2 additions and 3 deletions
|
@ -1,7 +1,5 @@
|
||||||
import logging
|
import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
|
||||||
from netbox_agent.misc import is_tool
|
|
||||||
|
|
||||||
from netbox_agent.misc import is_tool
|
from netbox_agent.misc import is_tool
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,8 @@ class ServerBase():
|
||||||
|
|
||||||
if (
|
if (
|
||||||
rack
|
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
|
and server.rack.id != nb_rack.id
|
||||||
):
|
):
|
||||||
logging.info('Rack location has changed from {} to {}, updating'.format(
|
logging.info('Rack location has changed from {} to {}, updating'.format(
|
||||||
|
|
Loading…
Reference in a new issue