X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Femuvim%2Fapi%2Frest%2Fnetwork.py;h=bce10fcb29a71a8de37e3b4c047710261719e3b0;hb=afccf2a6a1a99bf691b7d64360ef78ab1690fca5;hp=13743731e924348d4207b329f5ec61c43acbb1a7;hpb=e0f920e099b91a07e7cb2f3bb3a940a71b493f08;p=osm%2Fvim-emu.git diff --git a/src/emuvim/api/rest/network.py b/src/emuvim/api/rest/network.py index 1374373..bce10fc 100755 --- a/src/emuvim/api/rest/network.py +++ b/src/emuvim/api/rest/network.py @@ -80,16 +80,17 @@ class NetworkAction(Resource): # call DCNetwork method, not really datacenter specific API for now... # no check if vnfs are really connected to this datacenter... try: - # check if json data is a dict - data = request.args - # try json payload + # check json payload + logging.debug("json: {}".format(request.json)) + logging.debug("args: {}".format(request.args)) + data = request.json - # then no data + if data is None: + data = request.args if data is None: data = {} - elif type(data) is not dict: - data = json.loads(request.json) + logging.info("data: {}".format(data)) vnf_src_name = data.get("vnf_src_name") vnf_dst_name = data.get("vnf_dst_name") vnf_src_interface = data.get("vnf_src_interface")