examples: fix querying active connections
This commit is contained in:
@@ -47,13 +47,13 @@ active = manager_prop_iface.Get("org.freedesktop.NetworkManager", "ActiveConnect
|
|||||||
for a in active:
|
for a in active:
|
||||||
ac_proxy = bus.get_object("org.freedesktop.NetworkManager", a)
|
ac_proxy = bus.get_object("org.freedesktop.NetworkManager", a)
|
||||||
prop_iface = dbus.Interface(ac_proxy, "org.freedesktop.DBus.Properties")
|
prop_iface = dbus.Interface(ac_proxy, "org.freedesktop.DBus.Properties")
|
||||||
state = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "State")
|
state = prop_iface.Get("org.freedesktop.NetworkManager.Connection.Active", "State")
|
||||||
|
|
||||||
# Connections in NM are a collection of settings that describe everything
|
# Connections in NM are a collection of settings that describe everything
|
||||||
# needed to connect to a specific network. Lets get those details so we
|
# needed to connect to a specific network. Lets get those details so we
|
||||||
# can find the user-readable name of the connection.
|
# can find the user-readable name of the connection.
|
||||||
con_path = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "Connection")
|
con_path = prop_iface.Get("org.freedesktop.NetworkManager.Connection.Active", "Connection")
|
||||||
con_service = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "ServiceName")
|
con_service = prop_iface.Get("org.freedesktop.NetworkManager.Connection.Active", "ServiceName")
|
||||||
|
|
||||||
# ask the provider of the connection for its details
|
# ask the provider of the connection for its details
|
||||||
service_proxy = bus.get_object(con_service, con_path)
|
service_proxy = bus.get_object(con_service, con_path)
|
||||||
|
Reference in New Issue
Block a user