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
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',
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"]
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"]: