Skip to content

Commit 1588375

Browse files
committed
Merge branch 'issue3055' into develop
2 parents dd93371 + c027005 commit 1588375

File tree

7 files changed

+8
-11
lines changed

7 files changed

+8
-11
lines changed

Diff for: README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Optional dependencies:
112112
- ``influxdb-client`` (for the InfluxDB version 2 export module)
113113
- ``jinja2`` (for templating, used under the hood by FastAPI)
114114
- ``kafka-python`` (for the Kafka export module)
115-
- ``netifaces-plus`` (for the IP plugin)
115+
- ``netifaces2`` (for the IP plugin)
116116
- ``nvidia-ml-py`` (for the GPU plugin)
117117
- ``pycouchdb`` (for the CouchDB export module)
118118
- ``pika`` (for the RabbitMQ/ActiveMQ export module)

Diff for: docker-files/alpine.Dockerfile

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
# WARNING: the Alpine image version and Python version should be set.
1010
# Alpine 3.18 tag is a link to the latest 3.18.x version.
1111
# Be aware that if you change the Alpine version, you may have to change the Python version.
12-
13-
# Netifaces (and Netifaces-plus) are not compliant with GCC embeded in Alpine 3.21
14-
# See: https://github.com/tsukumijima/netifaces-plus/issues/9
15-
ARG IMAGE_VERSION=3.20
12+
ARG IMAGE_VERSION=3.21
1613
ARG PYTHON_VERSION=3.12
1714

1815
##############################################################################

Diff for: glances/plugins/ip/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def __init__(self, args=None, config=None):
8888
def get_private_ip(self, stats, stop=False):
8989
# Get the default gateway thanks to the netifaces lib
9090
try:
91-
default_gw = netifaces.gateways()['default'][netifaces.AF_INET]
91+
default_gw = netifaces.gateways()[netifaces.AF_INET][0]
9292
except (KeyError, AttributeError) as e:
9393
logger.debug(f"Cannot grab default gateway IP address ({e})")
9494
stop = True
@@ -99,7 +99,7 @@ def get_private_ip(self, stats, stop=False):
9999

100100
def get_first_ip(self, stats, stop=False):
101101
try:
102-
default_gw = netifaces.gateways()['default'][netifaces.AF_INET]
102+
default_gw = netifaces.gateways()[netifaces.AF_INET][0]
103103
address = netifaces.ifaddresses(default_gw[1])[netifaces.AF_INET][0]['addr']
104104
mask = netifaces.ifaddresses(default_gw[1])[netifaces.AF_INET][0]['netmask']
105105
except (KeyError, AttributeError) as e:

Diff for: glances/ports_list.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def load(self, config):
5050
if default_gateway.lower().startswith('true') and netifaces_tag:
5151
new_port = {}
5252
try:
53-
new_port['host'] = netifaces.gateways()['default'][netifaces.AF_INET][0]
53+
new_port['host'] = netifaces.gateways()[netifaces.AF_INET][0][0]
5454
except KeyError:
5555
new_port['host'] = None
5656
# ICMP

Diff for: glances/servers_list_dynamic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def find_active_ip_address():
244244
import netifaces
245245

246246
# Interface of the default gateway
247-
gateway_itf = netifaces.gateways()['default'][netifaces.AF_INET][1]
247+
gateway_itf = netifaces.gateways()[netifaces.AF_INET][0][1]
248248
# IP address for the interface
249249
return netifaces.ifaddresses(gateway_itf)[netifaces.AF_INET][0]['addr']
250250

Diff for: optional-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ influxdb>=1.0.0 # For InfluxDB < 1.8
1414
influxdb-client # For InfluxDB >= 1.8
1515
jinja2
1616
kafka-python
17-
netifaces-plus
17+
netifaces2
1818
nvidia-ml-py
1919
orjson
2020
paho-mqtt

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export = [
8484
]
8585
gpu = ["nvidia-ml-py"]
8686
graph = ["pygal"]
87-
ip = ["netifaces-plus"]
87+
ip = ["netifaces2"]
8888
raid = ["pymdstat"]
8989
sensors = ["batinfo; platform_system == 'Linux'"]
9090
smart = ["pySMART.smartx"]

0 commit comments

Comments
 (0)