projects
/
osm
/
vim-emu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'upstream/master'
[osm/vim-emu.git]
/
src
/
emuvim
/
api
/
rest
/
compute.py
diff --git
a/src/emuvim/api/rest/compute.py
b/src/emuvim/api/rest/compute.py
index
f8da428
..
1082a4d
100755
(executable)
--- 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
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")
data = json.loads(request.json)
network = data.get("network")
@@
-76,7
+78,8
@@
class ComputeStart(Resource):
'''
nw_list = list()
'''
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('),(')
return nw_list
networks = network_str[1:-1].split('),(')
@@
-103,10
+106,10
@@
class ComputeList(Resource):
global dcs
global dcs
- def get(self, dc_label):
+ def get(self, dc_label
=None
):
logging.debug("API CALL: compute list")
try:
logging.debug("API CALL: compute list")
try:
- if dc_label
== 'None'
:
+ if dc_label
is None
:
# return list with all compute nodes in all DCs
all_containers = []
for dc in dcs.itervalues():
# return list with all compute nodes in all DCs
all_containers = []
for dc in dcs.itervalues():