Use common logger for all new gitops operations 51/14551/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 11 Sep 2024 12:28:38 +0000 (14:28 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 11 Sep 2024 12:28:59 +0000 (14:28 +0200)
Change-Id: I48bb7b2bc74432a8a5ae2c1a20e2ba375a825653
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osm_lcm/k8s.py
osm_lcm/lcm.py
osm_lcm/odu_workflows.py

index 0e9a5c4..c48228e 100644 (file)
@@ -35,7 +35,7 @@ class ClusterLcm(LcmBase):
         :return: None
         """
 
-        self.logger = logging.getLogger("lcm.clusterlcm")
+        self.logger = logging.getLogger("lcm.gitops")
         self.lcm_tasks = lcm_tasks
         self.odu = odu_workflows.OduWorkflow(msg, self.lcm_tasks, config)
         self.regist = vim_sdn.K8sClusterLcm(msg, self.lcm_tasks, config)
@@ -529,7 +529,7 @@ class CloudCredentialsLcm(LcmBase):
         :return: None
         """
 
-        self.logger = logging.getLogger("lcm.cloud_credentials")
+        self.logger = logging.getLogger("lcm.gitops")
         self.lcm_tasks = lcm_tasks
         self.odu = odu_workflows.OduWorkflow(msg, self.lcm_tasks, config)
 
@@ -615,7 +615,7 @@ class K8sAppLcm(LcmBase):
         :return: None
         """
 
-        self.logger = logging.getLogger("lcm.clusterlcm")
+        self.logger = logging.getLogger("lcm.gitops")
         self.lcm_tasks = lcm_tasks
         self.odu = odu_workflows.OduWorkflow(msg, self.lcm_tasks, config)
 
@@ -729,7 +729,7 @@ class K8sResourceLcm(LcmBase):
         :return: None
         """
 
-        self.logger = logging.getLogger("lcm.clusterlcm")
+        self.logger = logging.getLogger("lcm.gitops")
         self.lcm_tasks = lcm_tasks
         self.odu = odu_workflows.OduWorkflow(msg, self.lcm_tasks, config)
 
@@ -844,7 +844,7 @@ class K8sInfraControllerLcm(LcmBase):
         :return: None
         """
 
-        self.logger = logging.getLogger("lcm.clusterlcm")
+        self.logger = logging.getLogger("lcm.gitops")
         self.lcm_tasks = lcm_tasks
         self.odu = odu_workflows.OduWorkflow(msg, self.lcm_tasks, config)
 
@@ -958,7 +958,7 @@ class K8sInfraConfigLcm(LcmBase):
         :return: None
         """
 
-        self.logger = logging.getLogger("lcm.clusterlcm")
+        self.logger = logging.getLogger("lcm.gitops")
         self.lcm_tasks = lcm_tasks
         self.odu = odu_workflows.OduWorkflow(msg, self.lcm_tasks, config)
 
@@ -1073,7 +1073,7 @@ class OkaLcm(LcmBase):
         :return: None
         """
 
-        self.logger = logging.getLogger("lcm.oka")
+        self.logger = logging.getLogger("lcm.gitops")
         self.lcm_tasks = lcm_tasks
         self.odu = odu_workflows.OduWorkflow(msg, self.lcm_tasks, config)
 
@@ -1241,7 +1241,7 @@ class KsuLcm(LcmBase):
         :return: None
         """
 
-        self.logger = logging.getLogger("lcm.ksu")
+        self.logger = logging.getLogger("lcm.gitops")
         self.lcm_tasks = lcm_tasks
         self.odu = odu_workflows.OduWorkflow(msg, self.lcm_tasks, config)
 
index 77c3d82..c685ed1 100644 (file)
@@ -149,7 +149,7 @@ class Lcm:
             self.logger.setLevel(self.main_config.globalConfig.loglevel)
 
         # logging other modules
-        for logger in ("message", "database", "storage", "tsdb"):
+        for logger in ("message", "database", "storage", "tsdb", "gitops"):
             logger_config = self.main_config.to_dict()[logger]
             logger_module = logging.getLogger(logger_config["logger_name"])
             if logger_config["logfile"]:
index bb3fce2..b882706 100644 (file)
@@ -28,7 +28,7 @@ class OduWorkflow(LcmBase):
         :return: None
         """
 
-        self.logger = logging.getLogger("lcm.odu")
+        self.logger = logging.getLogger("lcm.gitops")
         self.lcm_tasks = lcm_tasks
         self.logger.info("Msg: {} lcm_tasks: {} ".format(msg, lcm_tasks))