You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type: Ppp
Name: ppp0
Address: 10.0.0.11/32
DNS: 10.0.0.10
DNS: 8.8.8.8
Traceback (most recent call last):
File "/tmp/pycharm_project_872/network_manager_device_info.py", line 110, in <module>
asyncio.run(list_networkdevice_details_async())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/tmp/pycharm_project_872/network_manager_device_info.py", line 101, in list_networkdevice_details_async
connection_id = await get_most_recent_connection_id(dev_name, dev_type)
File "/tmp/pycharm_project_872/network_manager_device_info.py", line 39, in get_most_recent_connection_id
if connection.connection_type != getattr(ConnectionType, dev_type):
File "/usr/lib/python3.10/enum.py", line 437, in __getattr__
raise AttributeError(name) from None
AttributeError: PPP
So the Device D-Bus interface returns the 23 which in the DeviceType enum has a name PPP.
However, the PPP Device requires the Connection Settings type field set to "pppoe" so the correct value should be PPP = "pppoe".
However, the ConnectionType enum should probably be a map named REQUIRED_CONNECTION_SETTING_TYPE and it won't cover all device types as it seems that certain device types can support multiple connection settings.
Activity
igo95862 commentedon Jun 27, 2023
Hello,
I think there is a
PPPOEdevice type defined, however, it is probably the wrong name:python-sdbus-networkmanager/sdbus_async/networkmanager/enums.py
Line 550 in f1fcc1d
Can you try renaming it to
PPP = "ppp"?Regela commentedon Jun 27, 2023
No, PPOE and PPP it is a different things. I add PPP = "ppp" to ConnectionType enum and it solved my problem. Please, add it in repo )
igo95862 commentedon Nov 25, 2023
Hmmm...
Looking at the NetworkManager source code it looks like the PPP device connection setting type should be "pppoe"?
https://github.com/NetworkManager/NetworkManager/blob/02371a18b0bd1f30ae9d093646d49048d4944dc9/src/core/devices/nm-device-ppp.c#L327C25-L327C25
The
NM_SETTING_PPP_SETTING_NAMEseems to be almost unused anywhere in the source code.igo95862 commentedon Nov 25, 2023
Ok I think I get it.
So the Device D-Bus interface returns the
23which in theDeviceTypeenum has a namePPP.However, the PPP Device requires the Connection Settings type field set to
"pppoe"so the correct value should bePPP = "pppoe".However, the
ConnectionTypeenum should probably be a map namedREQUIRED_CONNECTION_SETTING_TYPEand it won't cover all device types as it seems that certain device types can support multiple connection settings.For example, VETH:
https://github.com/NetworkManager/NetworkManager/blob/02371a18b0bd1f30ae9d093646d49048d4944dc9/src/core/devices/nm-device-veth.c#L196