X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=blobdiff_plain;f=NG-RO%2Fosm_ng_ro%2Fns_thread.py;h=5df74c5c75763d4cfb7d9acb6077ede5f4946bdf;hp=f15831aab94fd04e083bb8e3409d75c5d545d6c0;hb=ee6a62063244ab492bc4d09cc5fe89388a5d1ea6;hpb=80135b928ab442c38898750b4751480205b4affc diff --git a/NG-RO/osm_ng_ro/ns_thread.py b/NG-RO/osm_ng_ro/ns_thread.py index f15831aa..5df74c5c 100644 --- a/NG-RO/osm_ng_ro/ns_thread.py +++ b/NG-RO/osm_ng_ro/ns_thread.py @@ -32,7 +32,7 @@ import yaml from copy import deepcopy from http import HTTPStatus from os import mkdir -from pkg_resources import iter_entry_points +from importlib_metadata import entry_points from shutil import rmtree from unittest.mock import Mock @@ -596,7 +596,7 @@ class VimInteractionImage(VimInteractionBase): ) elif len(vim_images) > 1: raise NsWorkerException( - "More than one network found with this criteria: '{}'".format( + "More than one image found with this criteria: '{}'".format( task["find_params"] ) ) @@ -921,7 +921,7 @@ class VimInteractionSdnNet(VimInteractionBase): else None, "service_endpoint_encapsulation_info": { "vlan": port.get("vlan"), - "mac": port.get("mac_address"), + "mac": port.get("mac-address"), "device_id": pmap.get("device_id") or port["compute_node"], "device_interface_id": pmap.get("device_interface_id") or port["pci"], @@ -1229,8 +1229,8 @@ class NsWorker(threading.Thread): return self.plugins[name] try: - for v in iter_entry_points("osm_ro{}.plugins".format(type), name): - self.plugins[name] = v.load() + for ep in entry_points(group="osm_ro{}.plugins".format(type), name=name): + self.plugins[name] = ep.load() except Exception as e: raise NsWorkerException("Cannot load plugin osm_{}: {}".format(name, e)) @@ -1758,6 +1758,11 @@ class NsWorker(threading.Thread): next_check_at = min( next_check_at, dependency_ro_task["to_check_at"] ) + # must allow dependent task to be processed first + # to do this set time after last_task_processed + next_check_at = max( + self.time_last_task_processed, next_check_at + ) break elif dependency_task["status"] == "FAILED": error_text = "Cannot {} {} because depends on failed {} {} id={}): {}".format(