Skip accessing unexisting Interface property
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 7 Dec 2009 08:28:54 +0000 (09:28 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 7 Dec 2009 08:28:54 +0000 (09:28 +0100)
test/disable-device
test/enable-device
test/test-connman

index 7aadab0..caa954f 100755 (executable)
@@ -20,8 +20,11 @@ for path in properties["Devices"]:
 
        properties = device.GetProperties()
 
+       if "Interface" not in properties.keys():
+               continue
+
        if properties["Interface"] != sys.argv[1]:
-               continue;
+               continue
 
        print "Disabling device %s" % (path)
 
index b5b1a9c..6451441 100755 (executable)
@@ -20,8 +20,11 @@ for path in properties["Devices"]:
 
        properties = device.GetProperties()
 
+       if "Interface" not in properties.keys():
+               continue
+
        if properties["Interface"] != sys.argv[1]:
-               continue;
+               continue
 
        print "Enabling device %s" % (path)
 
index f9ab201..c5da877 100755 (executable)
@@ -354,6 +354,9 @@ elif sys.argv[1] == "dev":
 
                properties = device.GetProperties()
 
+               if "Interface" not in properties.keys():
+                       continue
+
                if interface != "" and properties["Interface"] != interface:
                        continue