I'm trying to configure a NetworkManager connection (wifi) using dbus. I'm using Python dbus-next as this library comes handy in terms of its async support. I found out that the field 'address-data' is going to replace 'addresses' in the future. However, no matter with what I'm updating the IPv4 settings it always says:
dbus_next.errors.DBusError: ipv4.addresses: this property cannot be empty for 'method=manual'
And I'm running out of ideas what I might be doing wrong. It's pretty unclear why the settings below are not accepted. I also compared those to settings that I configured using gnome's networkmanager which uses dbus under the hood as well. Thus, there has got to be a way but I have not the slightest clue how to proceed.
These are the IPv4 settings I'm updating with:
'ipv4': {'address-data': <dbus_next.signature.Variant ('aa{sv}', [{'address': <dbus_next.signature.Variant ('s', 192.168.2.177)>, 'prefix': <dbus_next.signature.Variant ('u', 16)>}])>,
'addresses': <dbus_next.signature.Variant ('aau', [[3232236209, 4294966784, 3232236033]])>,
'dns': <dbus_next.signature.Variant ('au', [])>,
'dns-search': <dbus_next.signature.Variant ('as', [])>,
'gateway': <dbus_next.signature.Variant ('s', )>,
'method': <dbus_next.signature.Variant ('s', manual)>,
'route-data': <dbus_next.signature.Variant ('aa{sv}', [])>,
'routes': <dbus_next.signature.Variant ('aau', [])>},
... as you can see the field ipv4.addresses is clearly not empty. Thus, I have no clue why the error says so.
I also tested network managers reapply
method on an established connection with the same result.
This error is thrown if no connection was updated. The
addresses
member is deprecated. I removed it and were able to update the connection. This is a working example of theipv4
block:After that I called the
reapply_connection
method successfully. This method call will raise another exception if the device was not active but that's another story.