projects
/
osm
/
vim-emu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix son-emu-cli compatibility with son-emu REST API
[osm/vim-emu.git]
/
src
/
emuvim
/
api
/
rest
/
network.py
diff --git
a/src/emuvim/api/rest/network.py
b/src/emuvim/api/rest/network.py
index
28b5c66
..
f68507c
100755
(executable)
--- a/
src/emuvim/api/rest/network.py
+++ b/
src/emuvim/api/rest/network.py
@@
-38,7
+38,7
@@
from flask import request
import json
import networkx
import json
import networkx
-logging.basicConfig(level=logging.
INFO
)
+logging.basicConfig(level=logging.
DEBUG
)
CORS_HEADER = {'Access-Control-Allow-Origin': '*'}
CORS_HEADER = {'Access-Control-Allow-Origin': '*'}
@@
-81,16
+81,15
@@
class NetworkAction(Resource):
# no check if vnfs are really connected to this datacenter...
try:
# check json payload
# no check if vnfs are really connected to this datacenter...
try:
# check json payload
- logging.
debug
("json: {}".format(request.json))
- logging.
debug
("args: {}".format(request.args))
+ logging.
info
("json: {}".format(request.json))
+ logging.
info
("args: {}".format(request.args))
# when called directly with curl via REST
data = request.json
# when called directly with curl via REST
data = request.json
+ if data is None:
+ data = request.args
if data is None:
data = {}
if data is None:
data = {}
- # check if json data is a dict
- elif type(data) is not dict:
- data = json.loads(request.json)
logging.info("data: {}".format(data))
vnf_src_name = data.get("vnf_src_name")
logging.info("data: {}".format(data))
vnf_src_name = data.get("vnf_src_name")