From f47f157e728aa267d952e3ca22dbde38af6716f1 Mon Sep 17 00:00:00 2001 From: "Jarisch, Ferdinand" Date: Wed, 11 Dec 2024 12:52:14 +0100 Subject: [PATCH] Fix: Do not crash with stack trace on expectable error --- src/gallia/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallia/utils.py b/src/gallia/utils.py index 6e0f6cbe5..336bee5bc 100644 --- a/src/gallia/utils.py +++ b/src/gallia/utils.py @@ -351,7 +351,11 @@ def net_if_addrs() -> list[Interface]: if sys.platform != "linux": raise NotImplementedError("net_if_addrs() is only supported on Linux platforms") - p = subprocess.run(["ip", "-j", "address", "show"], capture_output=True, check=True) + try: + p = subprocess.run(["ip", "-j", "address", "show"], capture_output=True, check=True) + except FileNotFoundError as e: + logger.warning(f"Could not query information about interfaces: {e}") + return [] try: return [Interface(**item) for item in json.loads(p.stdout.decode())]