summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2020-03-04 14:50:59 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-04 14:50:59 +0000
commit39e21227338d7f41d673310b20786a9573e7089f (patch)
tree7c7160966e4284c8be1902bceeb95c77e5ab503f
parent5007ad36c29ec122c1098dee36c5869c760e876d (diff)
parent83e79104f3012f11dde94aa22ba2d6c286473c65 (diff)
Merge "Fix parameter convertion for JSON array or object in LCM API payload"
-rwxr-xr-xansible-server/src/main/ansible-server/RestServer.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/ansible-server/src/main/ansible-server/RestServer.py b/ansible-server/src/main/ansible-server/RestServer.py
index 483b8322..3f42bfe4 100755
--- a/ansible-server/src/main/ansible-server/RestServer.py
+++ b/ansible-server/src/main/ansible-server/RestServer.py
@@ -329,6 +329,13 @@ def process_pnf_playbook(input_json, Id, EnvParameters, time_now):
cherrypy.log("Request Decode: EnvParameters " + json.dumps(EnvParameters))
cherrypy.log("Request Decode: PlaybookName " + PlaybookName)
+ for key in EnvParameters:
+ value = EnvParameters[key]
+ if isinstance(value, (list, dict)):
+ valueStr = json.dumps(value)
+ # Need to dump two times to keep the backslash and double quotes, add backslash and single quotes for spaces
+ EnvParameters[key] = "\\'" + json.dumps(valueStr)[1:-1] + "\\'"
+
str_uuid = str(uuid.uuid4())
HomeDir = os.path.dirname(os.path.realpath("~/"))