)
op_id = content["current_operation"]
- self.logger.info("OP_id: {}".format(op_id))
- length = 0
+ self.logger.debug("OP_id: {}".format(op_id))
+ op_num = 0
for operation in content["operationHistory"]:
- self.logger.info("Operations: {}".format(operation))
+ self.logger.debug("Operations: {}".format(operation))
if operation["op_id"] == op_id:
- self.logger.info("Length: {}".format(length))
+ self.logger.debug("Found operation number: {}".format(op_num))
now = time()
if workflow_status:
- content["operationHistory"][length]["workflowState"] = "COMPLETED"
+ content["operationHistory"][op_num]["workflowState"] = "COMPLETED"
else:
- content["operationHistory"][length]["workflowState"] = "ERROR"
+ content["operationHistory"][op_num]["workflowState"] = "ERROR"
if resource_status:
- content["operationHistory"][length]["resourceState"] = "READY"
+ content["operationHistory"][op_num]["resourceState"] = "READY"
else:
- content["operationHistory"][length]["resourceState"] = "NOT_READY"
+ content["operationHistory"][op_num]["resourceState"] = "NOT_READY"
- content["operationHistory"][length]["endDate"] = now
+ content["operationHistory"][op_num]["endDate"] = now
break
- length += 1
- self.logger.info("content: {}".format(content))
+ op_num += 1
+ self.logger.debug("content: {}".format(content))
return content