fix(core): IPutil 65/41965/1
authorPeter Mikus <[email protected]>
Thu, 5 Dec 2024 13:28:14 +0000 (14:28 +0100)
committerPeter Mikus <[email protected]>
Thu, 5 Dec 2024 13:28:14 +0000 (14:28 +0100)
Signed-off-by: Peter Mikus <[email protected]>
Change-Id: Ie4a61ade1da312ddab078411c8a7db3ba59393f3

resources/libraries/python/IPUtil.py

index 672aa1a..309d824 100644 (file)
@@ -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(