Bug 1875 - Scale of KDUs fails when the KDU is instantiated with additional params 20/11620/3
authorGuillermo Calvino <guillermo.calvino@canonical.com>
Wed, 2 Feb 2022 18:04:50 +0000 (19:04 +0100)
committerGuillermo Calvino <guillermo.calvino@canonical.com>
Thu, 10 Feb 2022 17:03:22 +0000 (18:03 +0100)
Change-Id: Id51434772bbcc4ccdc50d6bde6c559e835c640dc
Signed-off-by: Guillermo Calvino <guillermo.calvino@canonical.com>
osm_lcm/ns.py

index e530b8c..8ec39ad 100644 (file)
@@ -5737,7 +5737,7 @@ class NsLcm(LcmBase):
                 ] = "Deleting the execution environments"
                 scale_process = "VCA"
                 for vca_info in vca_scaling_info:
-                    if vca_info["type"] == "delete":
+                    if vca_info["type"] == "delete" and not vca_info.get("osm_kdu_id"):
                         member_vnf_index = str(vca_info["member-vnf-index"])
                         self.logger.debug(
                             logging_text + "vdu info: {}".format(vca_info)
@@ -5750,14 +5750,6 @@ class NsLcm(LcmBase):
                             ] = "Scaling member_vnf_index={}, vdu_id={}, vdu_index={} ".format(
                                 member_vnf_index, vdu_id, vdu_index
                             )
-                        else:
-                            vdu_index = 0
-                            kdu_id = vca_info["osm_kdu_id"]
-                            stage[
-                                1
-                            ] = "Scaling member_vnf_index={}, kdu_id={}, vdu_index={} ".format(
-                                member_vnf_index, kdu_id, vdu_index
-                            )
                         stage[2] = step = "Scaling in VCA"
                         self._write_op_status(op_id=nslcmop_id, stage=stage)
                         vca_update = db_nsr["_admin"]["deployed"]["VCA"]
@@ -5873,7 +5865,7 @@ class NsLcm(LcmBase):
                 ] = "Creating new execution environments"
                 scale_process = "VCA"
                 for vca_info in vca_scaling_info:
-                    if vca_info["type"] == "create":
+                    if vca_info["type"] == "create" and not vca_info.get("osm_kdu_id"):
                         member_vnf_index = str(vca_info["member-vnf-index"])
                         self.logger.debug(
                             logging_text + "vdu info: {}".format(vca_info)
@@ -5961,43 +5953,6 @@ class NsLcm(LcmBase):
                                     task_instantiation_info=tasks_dict_info,
                                     stage=stage,
                                 )
-                        else:
-                            kdu_name = vca_info["osm_kdu_id"]
-                            descriptor_config = get_configuration(db_vnfd, kdu_name)
-                            if descriptor_config:
-                                vdu_id = None
-                                kdu_index = int(vca_info["kdu_index"])
-                                vdu_name = None
-                                kdur = next(
-                                    x
-                                    for x in db_vnfr["kdur"]
-                                    if x["kdu-name"] == kdu_name
-                                )
-                                deploy_params_kdu = {"OSM": get_osm_params(db_vnfr)}
-                                if kdur.get("additionalParams"):
-                                    deploy_params_kdu = parse_yaml_strings(
-                                        kdur["additionalParams"]
-                                    )
-
-                                self._deploy_n2vc(
-                                    logging_text=logging_text,
-                                    db_nsr=db_nsr,
-                                    db_vnfr=db_vnfr,
-                                    nslcmop_id=nslcmop_id,
-                                    nsr_id=nsr_id,
-                                    nsi_id=nsi_id,
-                                    vnfd_id=vnfd_id,
-                                    vdu_id=vdu_id,
-                                    kdu_name=kdu_name,
-                                    member_vnf_index=member_vnf_index,
-                                    vdu_index=kdu_index,
-                                    vdu_name=vdu_name,
-                                    deploy_params=deploy_params_kdu,
-                                    descriptor_config=descriptor_config,
-                                    base_folder=base_folder,
-                                    task_instantiation_info=tasks_dict_info,
-                                    stage=stage,
-                                )
             # SCALE-UP VCA - END
             scale_process = None