X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=NG-RO%2Fosm_ng_ro%2Fns_thread.py;h=6e9495682ec027b4a7a412305af74f27d11610e1;hb=6a6e3344cc0d68064a592941e33cdc6629eb3405;hp=71944464588a2d1e8aee6ed805010ecdfe9d0d86;hpb=ffee660727620a5d5c1e069ac28c09850ac57299;p=osm%2FRO.git diff --git a/NG-RO/osm_ng_ro/ns_thread.py b/NG-RO/osm_ng_ro/ns_thread.py index 71944464..6e949568 100644 --- a/NG-RO/osm_ng_ro/ns_thread.py +++ b/NG-RO/osm_ng_ro/ns_thread.py @@ -30,7 +30,6 @@ import logging from os import makedirs from os import path import queue -from shutil import rmtree import threading import time import traceback @@ -749,8 +748,10 @@ class VimInteractionFlavor(VimInteractionBase): try: flavor_data = task["find_params"]["flavor_data"] vim_flavor_id = target_vim.get_flavor_id_from_data(flavor_data) - except vimconn.VimConnNotFoundException: - self.logger.warning("VimConnNotFoundException occured.") + except vimconn.VimConnNotFoundException as flavor_not_found_msg: + self.logger.warning( + f"VimConnNotFoundException occured: {flavor_not_found_msg}" + ) if not vim_flavor_id and task.get("params"): # CREATE @@ -1658,10 +1659,6 @@ class NsWorker(threading.Thread): self.vim_targets.remove(target_id) self.logger.info("Unloaded {}".format(target_id)) - rmtree("{}:{}".format(target_id, self.worker_index)) - except FileNotFoundError: - # This is raised by rmtree if folder does not exist. - self.logger.exception("FileNotFoundError occured while unloading VIM.") except Exception as e: self.logger.error("Cannot unload {}: {}".format(target_id, e)) @@ -1794,9 +1791,9 @@ class NsWorker(threading.Thread): ) plugin_name = "" vim = None + step = "Getting {}={} from db".format(target, _id) try: - step = "Getting {}={} from db".format(target, _id) # TODO process for wim, sdnc, ... vim = self.db.get_one(target_database, {"_id": _id})