cleanup rest API issues
[osm/vim-emu.git] / src / emuvim / api / rest / compute.py
index f8da428..9f0516b 100755 (executable)
@@ -52,7 +52,9 @@ class ComputeStart(Resource):
         try:
             #check if json data is a dict
             data = request.json
-            if type(data) is not dict:
+            if data is None:
+                data = {}
+            elif type(data) is not dict:
                 data = json.loads(request.json)
 
             network = data.get("network")
@@ -76,7 +78,8 @@ class ComputeStart(Resource):
         '''
         nw_list = list()
 
-        if network_str is None or '),(' not in network_str :
+        # TODO make this more robust with regex check
+        if network_str is None :
             return nw_list
 
         networks = network_str[1:-1].split('),(')