summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2017-12-14 00:22:19 +0000
committerGerrit Code Review <gerrit@onap.org>2017-12-14 00:22:19 +0000
commite75a55aa542b4bac868010120b99371d09de1332 (patch)
tree4acf85eadff1dc3d3c1cef9ca77bbfeb163f4fcd
parent62de867020f6f7c7ad97eb6669282c9b8e558bbc (diff)
parente90193610f292c7d000f51592d03ebefdb8cd8d6 (diff)
Merge "Null POST/PUT bodies were causing REST failures"
-rw-r--r--aria/aria-rest-server/src/main/python/aria-rest/aria_rest/rest.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/aria/aria-rest-server/src/main/python/aria-rest/aria_rest/rest.py b/aria/aria-rest-server/src/main/python/aria-rest/aria_rest/rest.py
index 45fb4299d9..7b9223d1c9 100644
--- a/aria/aria-rest-server/src/main/python/aria-rest/aria_rest/rest.py
+++ b/aria/aria-rest-server/src/main/python/aria-rest/aria_rest/rest.py
@@ -116,7 +116,7 @@ def install_template(template_name, model_storage, resource_storage,
elif rtype == "json":
- body = request.json
+ body = request.json or {}
# Check body
if "service_template_path" in body:
@@ -169,7 +169,7 @@ def validate_template(model_storage, resource_storage, plugin_manager, logger):
"""
Validates a TOSCA template
"""
- body = request.json
+ body = request.json or {}
# Check body
if "service_template_path" in body:
@@ -385,7 +385,7 @@ def create_service(template_id, service_name, model_storage, resource_storage,
"""
Creates a service from the specified service template
"""
- body = request.json
+ body = request.json or {}
inputs = {}
if 'inputs' in body:
inputs = body['inputs']
@@ -542,7 +542,7 @@ def start_execution(
"""
Start an execution for the specified service
"""
- body = request.json
+ body = request.json or {}
executor = DryExecutor(
) if 'executor' in body and body['executor'] == 'dry' else None
@@ -585,7 +585,7 @@ def resume_execution(
"""
Resume the specified execution
"""
- body = request.json
+ body = request.json or {}
execution = model_storage.execution.get(execution_id)
if execution.status != execution.status.CANCELLED:
return "cancelled execution cannot be resumed", 400
@@ -619,7 +619,7 @@ def cancel_execution(execution_id, model_storage, logger):
Cancel the specified execution
"""
logger.info("cancelling execution {}".format(execution_id))
- body = request.json
+ body = request.json or {}
try:
execution = model_storage.execution.get(execution_id)