Bug 2317: Fix for Able to scale-in parent VM after a failed scale-out and NS update... 26/14026/2 release-v15.0-start
authorelumalai <deepika.e@tataelxsi.co.in>
Thu, 16 Nov 2023 09:06:05 +0000 (14:36 +0530)
committercubag <gcuba@whitestack.com>
Thu, 14 Dec 2023 15:00:49 +0000 (16:00 +0100)
Change-Id: I0563ea49c423e38c9c1605204eb073bbb9cd9faa
Signed-off-by: elumalai <deepika.e@tataelxsi.co.in>
osm_lcm/ns.py

index f282b88..71ede28 100644 (file)
@@ -5903,7 +5903,25 @@ class NsLcm(LcmBase):
                         if result == "FAILED":
                             nslcmop_operation_state = result
                             error_description_nslcmop = detailed_status
+                            old_operational_status = "failed"
                         db_nslcmop_update["detailed-status"] = detailed_status
+                        db_nsr_update["detailed-status"] = detailed_status
+                        scaling_aspect = get_scaling_aspect(latest_vnfd)
+                        scaling_group_desc = db_nsr.get("_admin").get(
+                            "scaling-group", None
+                        )
+                        if scaling_group_desc:
+                            for aspect in scaling_aspect:
+                                scaling_group_id = aspect.get("id")
+                                for scale_index, scaling_group in enumerate(
+                                    scaling_group_desc
+                                ):
+                                    if scaling_group.get("name") == scaling_group_id:
+                                        db_nsr_update[
+                                            "_admin.scaling-group.{}.nb-scale-op".format(
+                                                scale_index
+                                            )
+                                        ] = 0
                         self.logger.debug(
                             logging_text
                             + " step {} Done with result {} {}".format(