DBus: merge NetworkManger{,SystemSettings}
Remove the org.freedesktop.NetworkManagerSystemSettings bus name and have everybody talk to org.freedesktop.NetworkManager. Now that we have a single settings service that's embedded in the main daemon, we don't need separate names anymore.
This commit is contained in:
@@ -41,7 +41,7 @@ con = dbus.Dictionary({
|
||||
|
||||
bus = dbus.SystemBus()
|
||||
|
||||
proxy = bus.get_object("org.freedesktop.NetworkManagerSystemSettings", "/org/freedesktop/NetworkManagerSettings")
|
||||
proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManagerSettings")
|
||||
settings = dbus.Interface(proxy, "org.freedesktop.NetworkManagerSettings")
|
||||
|
||||
settings.AddConnection(con)
|
||||
|
@@ -53,7 +53,7 @@ for a in active:
|
||||
# needed to connect to a specific network. Lets get those details so we
|
||||
# can find the user-readable name of the connection.
|
||||
con_path = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "Connection")
|
||||
service_proxy = bus.get_object("org.freedesktop.NetworkManagerSystemSettings", con_path)
|
||||
service_proxy = bus.get_object("org.freedesktop.NetworkManager", con_path)
|
||||
con_iface = dbus.Interface(service_proxy, "org.freedesktop.NetworkManagerSettings.Connection")
|
||||
con_details = con_iface.GetSettings()
|
||||
con_name = con_details['connection']['id']
|
||||
|
@@ -37,7 +37,7 @@ DBusGMainLoop(set_as_default=True)
|
||||
|
||||
def get_connections():
|
||||
bus = dbus.SystemBus()
|
||||
proxy = bus.get_object('org.freedesktop.NetworkManagerSystemSettings', '/org/freedesktop/NetworkManagerSettings')
|
||||
proxy = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManagerSettings')
|
||||
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings')
|
||||
return iface.ListConnections()
|
||||
|
||||
@@ -45,7 +45,7 @@ def get_connections():
|
||||
def get_connection_by_uuid(uuid):
|
||||
bus = dbus.SystemBus()
|
||||
for c in get_connections():
|
||||
proxy = bus.get_object('org.freedesktop.NetworkManagerSystemSettings', c)
|
||||
proxy = bus.get_object('org.freedesktop.NetworkManager', c)
|
||||
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings.Connection')
|
||||
settings = iface.GetSettings()
|
||||
if settings['connection']['uuid'] == uuid:
|
||||
@@ -57,7 +57,7 @@ def get_connection_by_uuid(uuid):
|
||||
def list_uuids():
|
||||
bus = dbus.SystemBus()
|
||||
for c in get_connections():
|
||||
proxy = bus.get_object('org.freedesktop.NetworkManagerSystemSettings', c)
|
||||
proxy = bus.get_object('org.freedesktop.NetworkManager', c)
|
||||
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings.Connection')
|
||||
settings = iface.GetSettings()
|
||||
conn = settings['connection']
|
||||
@@ -76,7 +76,7 @@ def get_active_connection_path(uuid):
|
||||
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.DBus.Properties')
|
||||
path = iface.Get('org.freedesktop.NetworkManager.Connection.Active', 'Connection')
|
||||
|
||||
proxy = bus.get_object('org.freedesktop.NetworkManagerSystemSettings', path)
|
||||
proxy = bus.get_object('org.freedesktop.NetworkManager', path)
|
||||
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings.Connection')
|
||||
settings = iface.GetSettings()
|
||||
|
||||
@@ -112,7 +112,7 @@ def activate_connection(connection_path, device_path):
|
||||
bus = dbus.SystemBus()
|
||||
proxy = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager')
|
||||
iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManager')
|
||||
iface.ActivateConnection('org.freedesktop.NetworkManagerSystemSettings',
|
||||
iface.ActivateConnection('org.freedesktop.NetworkManager',
|
||||
connection_path,
|
||||
device_path,
|
||||
"/",
|
||||
|
Reference in New Issue
Block a user