From ca7bb74c3a1e631dbc8a5e05abcc708d888afdf8 Mon Sep 17 00:00:00 2001 From: clbu Date: Thu, 17 Oct 2024 16:52:22 +0200 Subject: [PATCH] fix(server): improve code --- netbox_agent/server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/netbox_agent/server.py b/netbox_agent/server.py index e1553c9..8e0553a 100644 --- a/netbox_agent/server.py +++ b/netbox_agent/server.py @@ -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!')