From 2cf92f93a9e3bd85c30ccba5aaac37ec1c2f2164 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 27 Jul 2025 15:41:15 +0200 Subject: [PATCH] Add another check for the famous Netifaces issue - Related to #3219 --- glances/ports_list.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/glances/ports_list.py b/glances/ports_list.py index 8d3cedb8..ca52f7d4 100644 --- a/glances/ports_list.py +++ b/glances/ports_list.py @@ -15,8 +15,19 @@ try: netifaces_tag = True except ImportError: + logger.warning("Ports plugin - Netifaces2 lib not found, port_default_gateway feature is disabled") netifaces_tag = False +try: + netifaces.gateways() +except Exception: + import_error_tag = True +else: + logger.warning( + "Ports plugin - Netifaces2 do not support gateways() method, port_default_gateway feature is disabled" + ) + import_error_tag = False + class GlancesPortsList: """Manage the ports list for the ports plugin."""