From 5910742dea81fdf29a27d9917f95c8d7432f2915 Mon Sep 17 00:00:00 2001
From: elumalai <deepika.e@tataelxsi.co.in>
Date: Fri, 20 Dec 2024 17:24:15 +0530
Subject: [PATCH] Revert "Bug_Fix-2350 NS Update failed while using
 Affinity/Anti-Affinity policy"

This reverts commit 53f34cf89ab243ee7a8b772b08df77c29290f14e.

Change-Id: I7b34370130a19a100a37ab0754c62adbf7b7da1b
Signed-off-by: elumalai <deepika.e@tataelxsi.co.in>
---
 NG-RO/osm_ng_ro/ns.py                         | 33 --------
 .../notes/fix_bug_2350-814291a32eed315f.yaml  | 81 -------------------
 2 files changed, 114 deletions(-)
 delete mode 100644 releasenotes/notes/fix_bug_2350-814291a32eed315f.yaml

diff --git a/NG-RO/osm_ng_ro/ns.py b/NG-RO/osm_ng_ro/ns.py
index c636aff9..c7780417 100644
--- a/NG-RO/osm_ng_ro/ns.py
+++ b/NG-RO/osm_ng_ro/ns.py
@@ -3107,37 +3107,6 @@ class Ns(object):
 
         return changes_list
 
-    def _remove_old_ro_tasks(self, nsr_id: str, changes_list: list, task_param) -> None:
-        """Delete all ro_tasks registered for the targets vdurs (target_record)
-        If task of type CREATE exist then vim will try to get info form deleted VMs.
-        So remove all task related to target record.
-
-        Args:
-            nsr_id (str):           NS record ID
-            changes_list   (list):  list of dictionaries to create tasks later
-        """
-
-        ro_tasks = self.db.get_list("ro_tasks", {"tasks.nsr_id": nsr_id})
-        for change in changes_list:
-            if task_param == "task_id":
-                param_to_check = "{}:{}".format(
-                    change.get("deployment_info", {}).get("action_id"),
-                    change.get("deployment_info", {}).get("task_index"),
-                )
-            elif task_param == "target_record":
-                param_to_check = change["target_record"]
-            for ro_task in ro_tasks:
-                for task in ro_task["tasks"]:
-                    if task[task_param] == param_to_check:
-                        self.db.del_one(
-                            "ro_tasks",
-                            q_filter={
-                                "_id": ro_task["_id"],
-                                "modified_at": ro_task["modified_at"],
-                            },
-                            fail_on_empty=False,
-                        )
-
     def recreate(self, session, indata, version, nsr_id, *args, **kwargs):
         self.logger.debug("ns.recreate nsr_id={} indata={}".format(nsr_id, indata))
         # TODO: validate_input(indata, recreate_schema)
@@ -3186,7 +3155,6 @@ class Ns(object):
                     tasks_by_target_record_id=tasks_by_target_record_id,
                 )
 
-                self._remove_old_ro_tasks(nsr_id, changes_list, "target_record")
                 self.define_all_tasks(
                     changes_list=changes_list,
                     db_new_tasks=db_new_tasks,
@@ -3391,7 +3359,6 @@ class Ns(object):
                         action_id=action_id,
                         tasks_by_target_record_id=tasks_by_target_record_id,
                     )
-                    self._remove_old_ro_tasks(nsr_id, changes_list, "task_id")
                     self.define_all_tasks(
                         changes_list=changes_list,
                         db_new_tasks=db_new_tasks,
diff --git a/releasenotes/notes/fix_bug_2350-814291a32eed315f.yaml b/releasenotes/notes/fix_bug_2350-814291a32eed315f.yaml
deleted file mode 100644
index 20ee4ba0..00000000
--- a/releasenotes/notes/fix_bug_2350-814291a32eed315f.yaml
+++ /dev/null
@@ -1,81 +0,0 @@
-#######################################################################################
-# Copyright ETSI Contributors and Others.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#######################################################################################
----
-prelude: >
-    Replace this text with content to appear at the top of the section for this
-    release. All of the prelude content is merged together and then rendered
-    separately from the items listed in other parts of the file, so the text
-    needs to be worded so that both the prelude and the other items make sense
-    when read independently. This may mean repeating some details. Not every
-    release note requires a prelude. Usually only notes describing major
-    features or adding release theme details should have a prelude.
-features:
-  - |
-    List new features here, or remove this section.  All of the list items in
-    this section are combined when the release notes are rendered, so the text
-    needs to be worded so that it does not depend on any information only
-    available in another section, such as the prelude. This may mean repeating
-    some details.
-issues:
-  - |
-    List known issues here, or remove this section.  All of the list items in
-    this section are combined when the release notes are rendered, so the text
-    needs to be worded so that it does not depend on any information only
-    available in another section, such as the prelude. This may mean repeating
-    some details.
-upgrade:
-  - |
-    List upgrade notes here, or remove this section.  All of the list items in
-    this section are combined when the release notes are rendered, so the text
-    needs to be worded so that it does not depend on any information only
-    available in another section, such as the prelude. This may mean repeating
-    some details.
-deprecations:
-  - |
-    List deprecations notes here, or remove this section.  All of the list
-    items in this section are combined when the release notes are rendered, so
-    the text needs to be worded so that it does not depend on any information
-    only available in another section, such as the prelude. This may mean
-    repeating some details.
-critical:
-  - |
-    Add critical notes here, or remove this section.  All of the list items in
-    this section are combined when the release notes are rendered, so the text
-    needs to be worded so that it does not depend on any information only
-    available in another section, such as the prelude. This may mean repeating
-    some details.
-security:
-  - |
-    Add security notes here, or remove this section.  All of the list items in
-    this section are combined when the release notes are rendered, so the text
-    needs to be worded so that it does not depend on any information only
-    available in another section, such as the prelude. This may mean repeating
-    some details.
-fixes:
-  - |
-    Add normal bug fixes here, or remove this section.  All of the list items
-    in this section are combined when the release notes are rendered, so the
-    text needs to be worded so that it does not depend on any information only
-    available in another section, such as the prelude. This may mean repeating
-    some details.
-other:
-  - |
-    Add other notes here, or remove this section.  All of the list items in
-    this section are combined when the release notes are rendered, so the text
-    needs to be worded so that it does not depend on any information only
-    available in another section, such as the prelude. This may mean repeating
-    some details.
-- 
GitLab