Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

missing routes in dict returned by gateways() #73

Open
blueforesticarus opened this issue Feb 8, 2021 · 2 comments
Open

missing routes in dict returned by gateways() #73

blueforesticarus opened this issue Feb 8, 2021 · 2 comments

Comments

@blueforesticarus
Copy link

Demo below, it seems to completely miss the route on ens160u2u1

bash$ ip route
default via 10.30.1.1 dev ens33 proto dhcp src 10.30.1.143 metric 1024 
10.30.1.0/24 dev ens33 proto kernel scope link src 10.30.1.143 
10.30.1.1 dev ens33 proto dhcp scope link src 10.30.1.143 metric 1024 
192.168.8.0/24 via 192.168.8.1 dev ens160u2u1

bash$ python
Python 3.9.1 (default, Dec 13 2020, 11:55:53) 
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import netifaces
>>> netifaces.gateways()
{'default': {2: ('10.30.1.1', 'ens33')}, 2: [('10.30.1.1', 'ens33', True)]}
>>> netifaces.version
'0.10.9'
>>> 
@blueforesticarus
Copy link
Author

bash$ uname -r
5.10.10-arch1-1

@hloeung
Copy link

hloeung commented Jun 10, 2021

Seeing this as well, same host, different netifaces version.

With the system package, python3-netifaces 0.10.4-1ubuntu4:

[hloeung@host ~]$ python3
Python 3.8.5 (default, May 27 2021, 13:30:53)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import netifaces
>>> netifaces.gateways()['default']
{2: ('185.134.xxx.xxx', 'ens1d1'), 10: ('2a06:ee01:xxx.xxx', 'ens1d1')}

With the wheelhouse bundled version, netifaces-0.11.0.tar.gz:

[hloeung@host ~]$ /var/lib/juju/agents/unit-fw-xxx-0/charm/bin/charm-env python3
Python 3.8.5 (default, May 27 2021, 13:30:53)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import netifaces
>>> netifaces.gateways()['default']
{10: ('2a06:ee01:xxx.xxx', 'ens1d1')}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants