aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--resources/libraries/python/IPUtil.py10
1 files 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(