Reduce log level to debug in update_operation_history 68/14668/2 master
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 22 Oct 2024 11:59:45 +0000 (13:59 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 22 Oct 2024 12:31:21 +0000 (14:31 +0200)
Change-Id: I835e7d0a0171fef78cea44b4c4e6d88fcc5180a1
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osm_lcm/lcm_utils.py

index e7b85cd..3106070 100644 (file)
@@ -238,27 +238,27 @@ class LcmBase:
         )
 
         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