Fix a crash

This commit is contained in:
Cyril Levis 2020-10-19 09:30:16 +02:00 committed by Your Name
commit ba66b3a7d0
No known key found for this signature in database
GPG key ID: 8538D68543979A20

View file

@ -79,7 +79,7 @@ class ServerBase():
update = True update = True
server.site = nb_dc.id server.site = nb_dc.id
if rack and server.rack and server.rack.id != nb_rack.id: if rack and all(map(lambda x: x is not None and "id" in x, (nb_rack, server.rack))) 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(
server.rack, server.rack,
nb_rack, nb_rack,