From: Peter Mikus Date: Thu, 5 Dec 2024 13:28:14 +0000 (+0100) Subject: fix(core): IPutil X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F65%2F41965%2F1;p=csit.git fix(core): IPutil Signed-off-by: Peter Mikus Change-Id: Ie4a61ade1da312ddab078411c8a7db3ba59393f3 --- diff --git a/resources/libraries/python/IPUtil.py b/resources/libraries/python/IPUtil.py index 672aa1ae3c..309d8241ee 100644 --- a/resources/libraries/python/IPUtil.py +++ b/resources/libraries/python/IPUtil.py @@ -394,12 +394,16 @@ class IPUtil: :raises RuntimeError: If cannot get the information about interfaces. """ cmd = f"grep '{pci_addr}' /sys/class/net/*/device/uevent" - msg = "Could not get information about interfaces" - stdout, stderr = exec_cmd_no_error(node, cmd, timeout=30, err_msg=msg) + ret_code, stdout, stderr = exec_cmd(node, cmd, timeout=30) + if ret_code != 0: + return None + try: return stdout.split("/")[4] except IndexError: - raise RuntimeError(f"{msg}:\n{stderr}") + raise RuntimeError( + f"Could not get information about interfaces:\n{stderr}" + ) @staticmethod def set_linux_interface_up(