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
{{ message }}
This repository was archived by the owner on Jan 27, 2023. It is now read-only.
NetworkManager >= 1.34 only provides the dns field as part of the org.freedesktop.NetworkManager.Settings.Connection.GetSettings reply if a custom DNS server is set in the connection config. This in turn causes python-networkmanager to fail as it always expects the dns field:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 9, in GetConnectionByUuid
File "/usr/lib/python3/dist-packages/NetworkManager.py", line 583, in to_python
val = fixups.base_to_python(val)
File "/usr/lib/python3/dist-packages/NetworkManager.py", line 653, in base_to_python
return globals()[classname](val)
File "/usr/lib/python3/dist-packages/NetworkManager.py", line 309, in __init__
self.uuid = self.GetSettings()['connection']['uuid']
File "<string>", line 8, in GetSettings
File "/usr/lib/python3/dist-packages/NetworkManager.py", line 624, in to_python
val['ipv4']['dns'] = [fixups.addr_to_python(addr,socket.AF_INET) for addr in val['ipv4']['dns']]
KeyError: 'dns'
This can be reproduced easily by adding/removing a custom DNS server to a connection config and then using dbus-send.
NetworkManager >= 1.34 only provides the
dnsfield as part of theorg.freedesktop.NetworkManager.Settings.Connection.GetSettingsreply if a custom DNS server is set in the connection config. This in turn causespython-networkmanagerto fail as it always expects thednsfield:This can be reproduced easily by adding/removing a custom DNS server to a connection config and then using
dbus-send.This in turn means that this code part shouldn't assume that the
dnsfield is available:https://github.com/seveas/python-networkmanager/blob/main/NetworkManager.py#L616-L623
The code part probably also shouldn't assume that the other fields are available either. ;-)