Bug 2317: Fix for Able to scale-in parent VM after a failed scale-out and NS update... 23/14023/1
authorelumalai <deepika.e@tataelxsi.co.in>
Thu, 16 Nov 2023 09:06:05 +0000 (14:36 +0530)
committerelumalai <deepika.e@tataelxsi.co.in>
Thu, 16 Nov 2023 09:06:05 +0000 (14:36 +0530)
Change-Id: I0563ea49c423e38c9c1605204eb073bbb9cd9faa
Signed-off-by: elumalai <deepika.e@tataelxsi.co.in>
osm_lcm/ns.py

index a3cdb74..382f9dc 100644 (file)
@@ -6110,7 +6110,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(