diff options
| author | Michael Biebl <biebl@debian.org> | 2021-10-01 23:06:08 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2021-10-01 23:06:08 +0200 |
| commit | a3349a04ac4c38885cddefec8515c979d03f9327 (patch) | |
| tree | d3bbee695aa048cb4ec252e7d63515c8376f9006 /examples/python/dbus/create-bond.py | |
| parent | 2d5b58e374d67f60880c7689e80c7745aeef3f62 (diff) | |
| parent | e74c568b07b50b97873fb4ee1d776dedefbd54d6 (diff) | |
Update upstream source from tag 'upstream/1.32.12'
Update to upstream version '1.32.12' with Debian dir 6fabefa95c7dcf83371a78eb2c47013a81ff8d86
Diffstat (limited to 'examples/python/dbus/create-bond.py')
| -rwxr-xr-x | examples/python/dbus/create-bond.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/examples/python/dbus/create-bond.py b/examples/python/dbus/create-bond.py index 4ebec24a..fe35fcc0 100755 --- a/examples/python/dbus/create-bond.py +++ b/examples/python/dbus/create-bond.py @@ -40,8 +40,8 @@ def create_bond(bond_name): "autoconnect-slaves": 1, } ) - s_ip4 = dbus.Dictionary({"method": "auto"}) - s_ip6 = dbus.Dictionary({"method": "ignore"}) + s_ip4 = dbus.Dictionary({"method": "disabled"}) + s_ip6 = dbus.Dictionary({"method": "disabled"}) con = dbus.Dictionary( {"bond": s_bond, "connection": s_con, "ipv4": s_ip4, "ipv6": s_ip6} @@ -97,18 +97,22 @@ print("Activating bond: %s (%s)" % (bond_name, ac)) loop = GLib.MainLoop() -def properties_changed(props): - if "State" in props: - if props["State"] == 2: +def properties_changed(interface_name, changed_properties, invalidated_properties): + if ( + interface_name == "org.freedesktop.NetworkManager.Connection.Active" + and "State" in changed_properties + ): + state = changed_properties["State"] + if state == 2: print("Successfully connected") loop.quit() - if props["State"] == 3 or props["State"] == 4: + if state == 3 or state == 4: print("Bond activation failed") loop.quit() obj = bus.get_object("org.freedesktop.NetworkManager", ac) -iface = dbus.Interface(obj, "org.freedesktop.NetworkManager.Connection.Active") +iface = dbus.Interface(obj, "org.freedesktop.DBus.Properties") iface.connect_to_signal("PropertiesChanged", properties_changed) loop.run() |