about summary refs log tree commit diff
path: root/examples/python/dbus/create-bond.py
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-05-11 22:08:45 +0200
committerMichael Biebl <biebl@debian.org>2018-05-11 22:08:45 +0200
commitee9c73a923909e23a649407be77e25235d769e25 (patch)
treee21c923621fa278e737da693df9eb60ea31a6067 /examples/python/dbus/create-bond.py
parentf60117b41d5433be1b4a96d82cd11d0c3dce9b63 (diff)
New upstream version 1.10.8 upstream/1.10.8
Diffstat (limited to 'examples/python/dbus/create-bond.py')
-rwxr-xr-xexamples/python/dbus/create-bond.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/python/dbus/create-bond.py b/examples/python/dbus/create-bond.py
index 4600b9c2..f36426ca 100755
--- a/examples/python/dbus/create-bond.py
+++ b/examples/python/dbus/create-bond.py
@@ -26,7 +26,7 @@
 
 import dbus, sys, uuid
 from dbus.mainloop.glib import DBusGMainLoop
-from gi.repository import GObject
+import gobject
 
 DBusGMainLoop(set_as_default=True)
 
@@ -54,7 +54,7 @@ def create_bond(bond_name):
         'connection': s_con,
         'ipv4': s_ip4,
         'ipv6': s_ip6})
-    print("Creating bond connection: %s" % bond_name)
+    print "Creating bond connection: %s" % bond_name
     return add_connection(con)
 
 def create_slave(device, master):
@@ -72,11 +72,11 @@ def create_slave(device, master):
     con = dbus.Dictionary({
         '802-3-ethernet': s_wired,
         'connection': s_con})
-    print("Creating slave connection: %s" % slave_name)
+    print "Creating slave connection: %s" % slave_name
     add_connection(con)
 
 def usage():
-    print("Usage: %s <bond_name> <ifname1> ..." % sys.argv[0])
+    print "Usage: %s <bond_name> <ifname1> ..." % sys.argv[0]
     sys.exit(0)
 
 
@@ -94,17 +94,17 @@ bus = dbus.SystemBus()
 proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager")
 manager = dbus.Interface(proxy, "org.freedesktop.NetworkManager")
 ac = manager.ActivateConnection(bond_path, "/", "/")
-print("Activating bond: %s (%s)" % (bond_name, ac))
+print "Activating bond: %s (%s)" % (bond_name, ac)
 
 # Monitor the active bond connection
-loop = GObject.MainLoop()
+loop = gobject.MainLoop()
 def properties_changed(props):
     if 'State' in props:
         if props['State'] == 2:
-            print("Succesfully connected")
+            print "Succesfully connected"
             loop.quit()
         if props['State'] == 3 or props['State'] == 4:
-            print("Bond activation failed")
+            print "Bond activation failed"
             loop.quit()
 
 obj = bus.get_object("org.freedesktop.NetworkManager", ac)