From 43eb254bf347be1a2fd5bed08b87ec87c8bd0376 Mon Sep 17 00:00:00 2001
From: "Chayal, Avteet (ac229e) ac229e@att.com" <ac229e@att.com>
Date: Wed, 4 Apr 2018 21:39:12 -0400
Subject: OPTFRA-214-requestState should be requestStatus

Fixed async response for placementDemand only scenario.

Issue-ID: OPTFRA-214

Change-Id: Ia9bdced85a874fd19e74b53e52702d45b3c67052
Signed-off-by: Chayal, Avteet (ac229e) ac229e@att.com <ac229e@att.com>
---
 osdf/optimizers/placementopt/conductor/conductor.py | 6 +++---
 osdf/templates/plc_opt_response.jsont               | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/osdf/optimizers/placementopt/conductor/conductor.py b/osdf/optimizers/placementopt/conductor/conductor.py
index 663857b..682f606 100644
--- a/osdf/optimizers/placementopt/conductor/conductor.py
+++ b/osdf/optimizers/placementopt/conductor/conductor.py
@@ -154,7 +154,7 @@ def conductor_response_processor(conductor_response, raw_response, req_id):
                     debug_log.debug("The key[{}] is not mapped and will not be returned in assignment info".format(key))
             composite_solutions.append(solution)
 
-    request_state = conductor_response['plans'][0]['status']
+    request_status = conductor_response['plans'][0]['status']
     transaction_id = raw_response.headers.get('transaction_id', "")
     status_message = conductor_response.get('plans')[0].get('message', "")
 
@@ -166,7 +166,7 @@ def conductor_response_processor(conductor_response, raw_response, req_id):
     resp = {
         "transactionId": transaction_id,
         "requestId": req_id,
-        "requestState": request_state,
+        "requestStatus": request_status,
         "statusMessage": status_message,
         "solutions": solution_info
     }
@@ -188,6 +188,6 @@ def conductor_no_solution_processor(conductor_response, raw_response, request_id
     templ = Template(open(template_placement_response).read())
     return json.loads(templ.render(composite_solutions=[], requestId=request_id, license_solutions=[],
                                    transactionId=raw_response.headers.get('transaction_id', ""),
-                                   requestState="completed", statusMessage=status_message, json=json))
+                                   requestStatus="completed", statusMessage=status_message, json=json))
 
 
diff --git a/osdf/templates/plc_opt_response.jsont b/osdf/templates/plc_opt_response.jsont
index 2bd9f71..e5709e7 100755
--- a/osdf/templates/plc_opt_response.jsont
+++ b/osdf/templates/plc_opt_response.jsont
@@ -1,7 +1,7 @@
 {
   "requestId": "{{requestId}}",
   "transactionId": "{{transacationId}}",
-  "requestState": "{{requestState}}",
+  "requestStatus": "{{requestStatus}}",
   "statusMessage": "{{statusMessage}}"
   "solutions": {
       "placementSolutions": {{ json.dumps(composite_solutions) }},
-- 
cgit 1.2.3-korg