X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2Fnetslice.py;h=6b0a6caa8c97d07d28b88da412e4eae1b2102c32;hb=843adbc77237767f62b198e9cbb5ffb4c7caf17d;hp=fe8a7b9ad31c03599dfa49661c1a6aa52d2681d7;hpb=744303e157182880777f169259ea7cd4431af1d7;p=osm%2FLCM.git diff --git a/osm_lcm/netslice.py b/osm_lcm/netslice.py index fe8a7b9..6b0a6ca 100644 --- a/osm_lcm/netslice.py +++ b/osm_lcm/netslice.py @@ -17,7 +17,7 @@ import asyncio import logging import logging.handlers import traceback -from osm_lcm import ROclient, ns +from osm_lcm import ROclient from osm_lcm.lcm_utils import LcmException, LcmBase, populate_dict, get_iterable, deep_get from osm_common.dbbase import DbException from time import time @@ -31,7 +31,7 @@ class NetsliceLcm(LcmBase): timeout_nsi_deploy = 2 * 3600 # default global timeout for deployment a nsi - def __init__(self, db, msg, fs, lcm_tasks, config, loop): + def __init__(self, db, msg, fs, lcm_tasks, config, loop, ns): """ Init, Connect to database, filesystem storage, and messaging :param config: two level dictionary with configuration. Top level should contain 'database', 'storage', @@ -41,7 +41,7 @@ class NetsliceLcm(LcmBase): self.logger = logging.getLogger('lcm.netslice') self.loop = loop self.lcm_tasks = lcm_tasks - self.ns = ns.NsLcm(db, msg, fs, lcm_tasks, config, loop) + self.ns = ns self.ro_config = config["ro_config"] self.timeout = config["timeout"] @@ -248,7 +248,7 @@ class NetsliceLcm(LcmBase): if nss_cp_item["nss-ref"] == nss["nss-id"]: db_nsds = self.db.get_one("nsds", {"_id": nss["nsdId"]}) # Go for nsd, and search the CP that match with nst:CP to get vld-id-ref - for cp_nsd in db_nsds["connection-point"]: + for cp_nsd in db_nsds.get("connection-point", ()): if cp_nsd["name"] == nss_cp_item["nsd-connection-point-ref"]: if nslcmop.get("operationParams"): if nslcmop["operationParams"].get("nsName") == nss["nsName"]: