test-connman: Use GetServices() instead GetProperties()
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Sun, 26 Feb 2012 12:01:36 +0000 (13:01 +0100)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 28 Feb 2012 12:31:54 +0000 (13:31 +0100)
GetProperties() does not return the services path anymore. Instead
the GetServices() method should be used.

test/test-connman

index e2ff23a..473af62 100755 (executable)
@@ -25,12 +25,7 @@ if len(sys.argv) < 2:
        sys.exit(1)
 
 def print_services(services):
-       for path in services:
-               service = dbus.Interface(bus.get_object("net.connman", path),
-                                               "net.connman.Service")
-
-               properties = service.GetProperties()
-
+       for path, properties in services:
                identifier = path[path.rfind("/") + 1:]
 
                if properties["Favorite"] == dbus.Boolean(1):
@@ -51,9 +46,7 @@ if sys.argv[1] == "state":
        print "System is %s" % (properties["State"])
 
 elif sys.argv[1] in ["services", "list", "show"]:
-       properties = manager.GetProperties()
-
-       print_services(properties["Services"])
+       print_services(manager.GetServices())
 
 elif sys.argv[1] in ["autoconnect", "autoconn"]:
        if (len(sys.argv) < 3):