diff --git a/osm_lcm/k8s.py b/osm_lcm/k8s.py index ab6001b74f9c65a74c59abb060660622eb489873..3d974fcebaae7b4a318db986b6e546ebc7a92074 100644 --- a/osm_lcm/k8s.py +++ b/osm_lcm/k8s.py @@ -101,22 +101,24 @@ class GitOpsLcm(LcmBase): self.logger.debug("Operations: {}".format(operation)) if operation["op_id"] == op_id: self.logger.debug("Found operation number: {}".format(op_num)) - if workflow_status: - operation["workflowState"] = "COMPLETED" - operation["result"] = True - else: - operation["workflowState"] = "ERROR" - operation["operationState"] = "FAILED" - operation["result"] = False - - if resource_status: - operation["resourceState"] = "READY" - operation["operationState"] = "COMPLETED" - operation["result"] = True - else: - operation["resourceState"] = "NOT_READY" - operation["operationState"] = "FAILED" - operation["result"] = False + if workflow_status is not None: + if workflow_status: + operation["workflowState"] = "COMPLETED" + operation["result"] = True + else: + operation["workflowState"] = "ERROR" + operation["operationState"] = "FAILED" + operation["result"] = False + + if resource_status is not None: + if resource_status: + operation["resourceState"] = "READY" + operation["operationState"] = "COMPLETED" + operation["result"] = True + else: + operation["resourceState"] = "NOT_READY" + operation["operationState"] = "FAILED" + operation["result"] = False if op_end: now = time()