From 7d92dae744067aff030e32c3324b96242c1bcb08 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 6 Jul 2022 16:08:36 +0000 Subject: [PATCH] Increase timeout to 61 and sort NICs --- bootstrap-daemon/pvcbootstrapd/lib/redfish.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bootstrap-daemon/pvcbootstrapd/lib/redfish.py b/bootstrap-daemon/pvcbootstrapd/lib/redfish.py index e36bc26..8a4e4ba 100755 --- a/bootstrap-daemon/pvcbootstrapd/lib/redfish.py +++ b/bootstrap-daemon/pvcbootstrapd/lib/redfish.py @@ -86,7 +86,7 @@ class RedfishSession: login_response = None tries = 1 - max_tries = 31 + max_tries = 61 while tries < max_tries: logger.info(f"Trying to log in to Redfish ({tries}/{max_tries - 1})...") try: @@ -748,7 +748,9 @@ def redfish_init(config, cspec, data): try: ethernet_root = system_detail["EthernetInterfaces"]["@odata.id"].rstrip("/") ethernet_detail = session.get(ethernet_root) - first_interface_root = ethernet_detail["Members"][0]["@odata.id"].rstrip("/") + embedded_ethernet_detail_members = [e for e in ethernet_detail["Members"] if "Embedded" in e["@odata.id"]] + embedded_ethernet_detail_members.sort(key = lambda k: k["@odata.id"]) + first_interface_root = embedded_ethernet_detail_members[0]["@odata.id"].rstrip("/") first_interface_detail = session.get(first_interface_root) # Something went wrong, so fall back except KeyError: