From: Pedro Pereira Date: Fri, 23 Aug 2024 09:23:02 +0000 (+0100) Subject: Feature 10983: changes to migrate() function so that it can handle both VNF and KNF... X-Git-Tag: v17.0.0~14 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F39%2F14539%2F9;p=osm%2FLCM.git Feature 10983: changes to migrate() function so that it can handle both VNF and KNF migration Change-Id: Ic1cbc0db3492c15fe7bfb3c82cbdd47195a814d6 Signed-off-by: Pedro Pereira --- diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index ccfda6d4..5d3c9116 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -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