Add exception handling to some service method calls
[connman] / test / list-networks
index d8958fb..e8fb00a 100755 (executable)
@@ -25,8 +25,12 @@ for path in properties["Devices"]:
 
        properties = device.GetProperties()
 
-       if properties["Type"] not in ["wifi", "wimax", "bluetooth"]:
-               continue;
+       try:
+               if properties["Type"] not in ["wifi", "wimax",
+                                       "bluetooth", "cellular"]:
+                       continue
+       except:
+               continue
 
        print "[ %s ]" % (path)
 
@@ -39,10 +43,10 @@ for path in properties["Devices"]:
                print "    [ %s ]" % (path)
 
                for key in properties.keys():
-                       if (key == "WiFi.SSID"):
+                       if key == "WiFi.SSID":
                                ssid = convert_ssid(properties[key])
                                print "        %s = [ %s ]" % (key, ssid)
-                       elif (key == "Strength"):
+                       elif key in ["Strength", "Priority"]:
                                print "        %s = %d" % (key, properties[key])
                        else:
                                print "        %s = %s" % (key, properties[key])