- image = json.loads(request.json).get("image")
- network = json.loads(request.json).get("network")
- command = json.loads(request.json).get("docker_command")
+ # check if json data is a dict
+ data = request.json
+ if data is None:
+ data = {}
+ elif type(data) is not dict:
+ data = json.loads(request.json)
+
+ network = data.get("network")
+ nw_list = self._parse_network(network)
+ image = data.get("image")
+ command = data.get("docker_command")
+
+ try:
+ logging.debug("API CALL: compute start")