From: aktas Date: Tue, 4 May 2021 16:32:45 +0000 (+0300) Subject: Bug 1526 Fix X-Git-Tag: v9.1.2~5 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F02%2F10802%2F1;p=osm%2FLCM.git Bug 1526 Fix If vnfd:id and vnfd:df:lcm-operations-configuration:operate-vnf-op-config:day1-2:id are not the same, it fails to add the relation defined in NSD. Change-Id: I15e0a23c726fe4257c1b628faae2b2b50c0675e9 Signed-off-by: aktas (cherry picked from commit 45966a0a302621ed3f2d03f50cd61a584fddf0ab) --- diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 230a9bf..960fd31 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -2063,8 +2063,11 @@ class NsLcm(LcmBase): db_vnfd_list = db_nsr.get('vnfd-id') if db_vnfd_list: for vnfd in db_vnfd_list: + db_vnf_relations = None db_vnfd = self.db.get_one("vnfds", {"_id": vnfd}) - db_vnf_relations = get_configuration(db_vnfd, db_vnfd["id"]).get("relation", []) + db_vnf_configuration = get_configuration(db_vnfd, db_vnfd["id"]) + if db_vnf_configuration: + db_vnf_relations = db_vnf_configuration.get("relation", []) if db_vnf_relations: for r in db_vnf_relations: # check if this VCA is in the relation