From: aktas Date: Thu, 29 Jul 2021 14:42:49 +0000 (+0300) Subject: Bug 1609 fix X-Git-Tag: v10.0.3~2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F17%2F11117%2F1;p=osm%2FLCM.git Bug 1609 fix The fix requires merging this https://osm.etsi.org/gerrit/c/osm/N2VC/+/11086 commit. Then it can pass the jenkins w/o failure Change-Id: Icef9a467b8b037db33a0cf3c444247378ff6499b Signed-off-by: aktas (cherry picked from commit 98488edea54d619415d18c72a3b213ac2b75e5aa) --- diff --git a/.gitignore b/.gitignore index e6dc4cb4..4517ab1c 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ nosetests.xml .pydevproject pyvenv.cfg venv/ +.idea \ No newline at end of file diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 6a4a8e6e..1c18ec75 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -1603,17 +1603,22 @@ class NsLcm(LcmBase): namespace = "{nsi}.{ns}".format(nsi=nsi_id if nsi_id else "", ns=nsr_id) + if vca_type == "native_charm": + index_number = 0 + else: + index_number = vdu_index or 0 + if vnfr_id: element_type = "VNF" element_under_configuration = vnfr_id - namespace += ".{}-{}".format(vnfr_id, vdu_index or 0) + namespace += ".{}-{}".format(vnfr_id, index_number) if vdu_id: - namespace += ".{}-{}".format(vdu_id, vdu_index or 0) + namespace += ".{}-{}".format(vdu_id, index_number) element_type = "VDU" - element_under_configuration = "{}-{}".format(vdu_id, vdu_index or 0) + element_under_configuration = "{}-{}".format(vdu_id, index_number) osm_config["osm"]["vdu_id"] = vdu_id elif kdu_name: - namespace += ".{}.{}".format(kdu_name, vdu_index or 0) + namespace += ".{}".format(kdu_name) element_type = "KDU" element_under_configuration = kdu_name osm_config["osm"]["kdu_name"] = kdu_name @@ -1806,6 +1811,7 @@ class NsLcm(LcmBase): config=config, num_units=num_units, vca_id=vca_id, + vca_type=vca_type, ) # write in db flag of configuration_sw already installed @@ -1922,6 +1928,7 @@ class NsLcm(LcmBase): params_dict=primitive_params_, db_dict=db_dict, vca_id=vca_id, + vca_type=vca_type, ) # Once some primitive has been exec, check and write at db if it needs to exec terminated primitives if check_if_terminated_needed: @@ -3745,6 +3752,7 @@ class NsLcm(LcmBase): await self.vca_map[vca_type].delete_execution_environment( vca_deployed["ee_id"], scaling_in=scaling_in, + vca_type=vca_type, vca_id=vca_id, ) @@ -4518,6 +4526,7 @@ class NsLcm(LcmBase): total_timeout=self.timeout_primitive, db_dict=db_dict, vca_id=vca_id, + vca_type=vca_type, ), timeout=timeout or self.timeout_primitive, )