fix(server): improve code

This commit is contained in:
clbu 2024-10-17 16:52:22 +02:00
parent 2caf2a0042
commit ca7bb74c3a
No known key found for this signature in database
GPG key ID: 0891443A5398527F

View file

@ -483,11 +483,12 @@ class ServerBase():
if update:
expansion.save()
myip = nb.ipam.ip_addresses.filter(device_id=server.id)
myips = nb.ipam.ip_addresses.filter(device_id=server.id)
for ip in myip:
for ip in myips:
if ip.assigned_object.display == "IPMI":
server.update({'oob_ip': ip.id})
break
logging.debug('Finished updating Server!')