fixes issue with redfish source and sorting resource with no names

This commit is contained in:
ricardo.bartels@telekom.de
2024-12-12 16:39:18 +01:00
parent 740f1e1fca
commit 9d11567206
@@ -270,7 +270,7 @@ class CheckRedfish(SourceBase):
if grab(ps, "data.device") == self.device_object:
current_ps.append(ps)
current_ps.sort(key=lambda x: grab(x, "data.name"))
current_ps.sort(key=lambda x: grab(x, "data.name") or "")
ps_index = 1
ps_items = list()
@@ -944,7 +944,7 @@ class CheckRedfish(SourceBase):
unmatched_inventory_items.append(item)
# sort unmatched items by full_name
unmatched_inventory_items.sort(key=lambda x: x.get("full_name"))
unmatched_inventory_items.sort(key=lambda x: x.get("full_name") or "")
# iterate over current NetBox inventory items
# if name did not match try to assign unmatched items in alphabetical order