diff options
author | Peter Mikus <peter.mikus@protonmail.ch> | 2024-12-05 14:28:14 +0100 |
---|---|---|
committer | Peter Mikus <peter.mikus@protonmail.ch> | 2024-12-05 14:28:14 +0100 |
commit | 80bc2f2551754df151a8ed275e1326110e40dd52 (patch) | |
tree | 3ea7247f2b573bdf2810636909a5726dc0baa43c /resources/libraries/python | |
parent | bb8a6462b8508108bf886f9c1d9d53d9ebf3f71a (diff) |
fix(core): IPutil
Signed-off-by: Peter Mikus <peter.mikus@protonmail.ch>
Change-Id: Ie4a61ade1da312ddab078411c8a7db3ba59393f3
Diffstat (limited to 'resources/libraries/python')
-rw-r--r-- | resources/libraries/python/IPUtil.py | 10 |
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( |