Enables pylint in LCM and deletes unused methods
[osm/LCM.git] / osm_lcm / vim_sdn.py
index 0c22305..d95df94 100644 (file)
@@ -1006,7 +1006,7 @@ class SdnLcm(LcmBase):
         logging_text = "Task sdn_delete={} ".format(sdn_id)
         self.logger.debug(logging_text + "Enter")
 
-        db_sdn = None
+        db_sdn = {}
         db_sdn_update = {}
         exc = None
         step = "Getting sdn from db"
@@ -1039,7 +1039,7 @@ class SdnLcm(LcmBase):
                     logging_text + "Skipping. There is not RO information at database"
                 )
             self.db.del_one("sdns", {"_id": sdn_id})
-            db_sdn = None
+            db_sdn = {}
             self.logger.debug("sdn_delete task sdn_id={} Exit Ok".format(sdn_id))
             return
 
@@ -1474,9 +1474,10 @@ class VcaLcm(LcmBase):
         vca_id = vca_content["_id"]
         self.logger.debug("Task vca_create={} {}".format(vca_id, "Enter"))
 
-        db_vca = None
         db_vca_update = {}
 
+        operation_state = "FAILED"
+        operation_details = ""
         try:
             self.logger.debug(
                 "Task vca_create={} {}".format(vca_id, "Getting vca from db")
@@ -1514,7 +1515,6 @@ class VcaLcm(LcmBase):
             self.logger.error("Task vca_create={} {}".format(vca_id, error_msg))
             db_vca_update["_admin.operationalState"] = "ERROR"
             db_vca_update["_admin.detailed-status"] = error_msg
-            operation_state = "FAILED"
             operation_details = error_msg
         finally:
             try:
@@ -1549,6 +1549,9 @@ class VcaLcm(LcmBase):
         db_vca_update = {}
         vca_id = vca_content["_id"]
 
+        operation_state = "FAILED"
+        operation_details = ""
+
         try:
             self.logger.debug(
                 "Task vca_delete={} {}".format(vca_id, "Deleting vca from db")
@@ -1568,7 +1571,6 @@ class VcaLcm(LcmBase):
             self.logger.error("Task vca_delete={} {}".format(vca_id, error_msg))
             db_vca_update["_admin.operationalState"] = "ERROR"
             db_vca_update["_admin.detailed-status"] = error_msg
-            operation_state = "FAILED"
             operation_details = error_msg
         finally:
             try: