From 80bc2f2551754df151a8ed275e1326110e40dd52 Mon Sep 17 00:00:00 2001 From: Peter Mikus Date: Thu, 5 Dec 2024 14:28:14 +0100 Subject: fix(core): IPutil Signed-off-by: Peter Mikus Change-Id: Ie4a61ade1da312ddab078411c8a7db3ba59393f3 --- resources/libraries/python/IPUtil.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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( -- cgit 1.2.3-korg