Fix bug 1716: remove vcaId from NSR instantiation parameter 84/11284/1 release-v11.0-start
authorDavid Garcia <david.garcia@canonical.com>
Thu, 21 Oct 2021 14:39:21 +0000 (16:39 +0200)
committerDavid Garcia <david.garcia@canonical.com>
Thu, 21 Oct 2021 14:57:09 +0000 (16:57 +0200)
Change-Id: I9b19f09309886608a04e779d18702c1bdf32052c
Signed-off-by: David Garcia <david.garcia@canonical.com>
osm_nbi/instance_topics.py

index de77d5d..243a199 100644 (file)
@@ -432,18 +432,6 @@ class NsrTopic(BaseTopic):
 
         return ns_k8s_namespace
 
-    def _get_vim_account(self, vim_id: str, session):
-        try:
-            db_filter = self._get_project_filter(session)
-            db_filter["_id"] = vim_id
-            return self.db.get_one("vim_accounts", db_filter)
-        except Exception:
-            raise EngineException(
-                "Invalid vimAccountId='{}' not present for the project".format(
-                    vim_id
-                )
-            )
-
     def _create_nsr_descriptor_from_nsd(self, nsd, ns_request, nsr_id, session):
         now = time()
         additional_params, _ = self._format_additional_params(
@@ -490,10 +478,6 @@ class NsrTopic(BaseTopic):
         ns_request["nsr_id"] = nsr_id
         if ns_request and ns_request.get("config-units"):
             nsr_descriptor["config-units"] = ns_request["config-units"]
-        vim_account_id = nsr_descriptor["instantiate_params"].get("vimAccountId")
-        if vim_account_id:
-            vca_id = self._get_vim_account(vim_account_id, session).get("vca")
-            nsr_descriptor["instantiate_params"]["vcaId"] = vca_id
         # Create vld
         if nsd.get("virtual-link-desc"):
             nsr_vld = deepcopy(nsd.get("virtual-link-desc", []))