Add another check for the famous Netifaces issue - Related to #3219

This commit is contained in:
nicolargo 2025-07-27 15:41:15 +02:00
parent 89118e53de
commit 2cf92f93a9
1 changed files with 11 additions and 0 deletions

View File

@ -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."""