libnm: Add support to pass options to AddAndActivateConnection

This adds the new methods nm_client_add_and_activate_connection_options_*
and ports the existing methods to use the new AddAndActivateConnection2
call rather than AddAndActivateConnection, allowing further parameters
to be passed in.
This commit is contained in:
Benjamin Berg
2018-10-26 13:44:38 +02:00
committed by Thomas Haller
parent eb883e34a5
commit 00236ef977
6 changed files with 140 additions and 7 deletions

View File

@@ -1341,6 +1341,12 @@ class NetworkManager(ExportedObj):
@dbus.service.method(dbus_interface=IFACE_NM, in_signature='a{sa{sv}}oo', out_signature='oo')
def AddAndActivateConnection(self, con_hash, devpath, specific_object):
return self.AddAndActivateConnection2(con_hash, devpath, specific_object, dict())
@dbus.service.method(dbus_interface=IFACE_NM, in_signature='a{sa{sv}}ooa{sv}', out_signature='oo')
def AddAndActivateConnection2(self, con_hash, devpath, specific_object, options):
# TODO: Do some processing of the "options" parameter.
device = self.find_device_first(path = devpath, require = BusErr.UnknownDeviceException)
conpath = gl.settings.AddConnection(con_hash)
return (conpath, self.ActivateConnection(conpath, devpath, specific_object))