Updating result and operationState in operationHistory 11/14711/2
authorshahithya <shahithya.y@tataelxsi.co.in>
Thu, 7 Nov 2024 09:39:07 +0000 (09:39 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 8 Nov 2024 14:51:36 +0000 (15:51 +0100)
Change-Id: I38c3ec750c3cfe2a99e0c7ca6f180b9518885ac6
Signed-off-by: shahithya <shahithya.y@tataelxsi.co.in>
osm_lcm/lcm_utils.py

index 3106070..925fd2d 100644 (file)
@@ -247,13 +247,20 @@ class LcmBase:
                 now = time()
                 if workflow_status:
                     content["operationHistory"][op_num]["workflowState"] = "COMPLETED"
+                    content["operationHistory"][op_num]["result"] = True
                 else:
                     content["operationHistory"][op_num]["workflowState"] = "ERROR"
+                    content["operationHistory"][op_num]["operationState"] = "FAILED"
+                    content["operationHistory"][op_num]["result"] = False
 
                 if resource_status:
                     content["operationHistory"][op_num]["resourceState"] = "READY"
+                    content["operationHistory"][op_num]["operationState"] = "COMPLETED"
+                    content["operationHistory"][op_num]["result"] = True
                 else:
                     content["operationHistory"][op_num]["resourceState"] = "NOT_READY"
+                    content["operationHistory"][op_num]["operationState"] = "FAILED"
+                    content["operationHistory"][op_num]["result"] = False
 
                 content["operationHistory"][op_num]["endDate"] = now
                 break