X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Femuvim%2Fapi%2Frest%2Fcompute.py;h=9f0516b3cc8355aeb52230508b78300a7333c3b7;hb=e662ef8d5d4370961a9aa896c66615e7fa66819a;hp=f8da42843e02a7a52686ab687201499c539c2612;hpb=ff6b404f001a0460252a29051bc34c07c91e4cf1;p=osm%2Fvim-emu.git diff --git a/src/emuvim/api/rest/compute.py b/src/emuvim/api/rest/compute.py index f8da428..9f0516b 100755 --- a/src/emuvim/api/rest/compute.py +++ b/src/emuvim/api/rest/compute.py @@ -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('),(')