Feature 10983: changes to migrate() function so that it can handle both VNF and KNF... 39/14539/9
authorPedro Pereira <pedrocjdpereira@av.it.pt>
Fri, 23 Aug 2024 09:23:02 +0000 (10:23 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 12 Dec 2024 13:24:00 +0000 (14:24 +0100)
Change-Id: Ic1cbc0db3492c15fe7bfb3c82cbdd47195a814d6
Signed-off-by: Pedro Pereira <pedrocjdpereira@av.it.pt>
osm_lcm/ns.py

index ccfda6d..5d3c911 100644 (file)
@@ -7979,17 +7979,23 @@ class NsLcm(LcmBase):
 
             target = {}
             target.update(migrate_params)
-            desc = await self.RO.migrate(nsr_id, target)
-            self.logger.debug("RO return > {}".format(desc))
-            action_id = desc["action_id"]
-            await self._wait_ng_ro(
-                nsr_id,
-                action_id,
-                nslcmop_id,
-                start_deploy,
-                self.timeout.migrate,
-                operation="migrate",
-            )
+
+            if "migrateToHost" in target:
+                desc = await self.RO.migrate(nsr_id, target)
+                self.logger.debug("RO return > {}".format(desc))
+                action_id = desc["action_id"]
+                await self._wait_ng_ro(
+                    nsr_id,
+                    action_id,
+                    nslcmop_id,
+                    start_deploy,
+                    self.timeout.migrate,
+                    operation="migrate",
+                )
+
+            elif "targetHostK8sLabels" in target:
+                await self.k8sclusterhelm3.migrate(nsr_id, target)
+
         except (ROclient.ROClientException, DbException, LcmException) as e:
             self.logger.error("Exit Exception {}".format(e))
             exc = e