Fix for test_remove_vnf failing in Heal VDU
[osm/LCM.git] / osm_lcm / lcm.py
index 060aa07..9eb37fa 100644 (file)
@@ -439,6 +439,14 @@ class Lcm:
                 task = asyncio.ensure_future(self.ns.action(nsr_id, nslcmop_id))
                 self.lcm_tasks.register("ns", nsr_id, nslcmop_id, "ns_action", task)
                 return
+            elif command == "update":
+                # self.logger.debug("Update NS {}".format(nsr_id))
+                nslcmop = params
+                nslcmop_id = nslcmop["_id"]
+                nsr_id = nslcmop["nsInstanceId"]
+                task = asyncio.ensure_future(self.ns.update(nsr_id, nslcmop_id))
+                self.lcm_tasks.register("ns", nsr_id, nslcmop_id, "ns_update", task)
+                return
             elif command == "scale":
                 # self.logger.debug("Update NS {}".format(nsr_id))
                 nslcmop = params
@@ -447,6 +455,13 @@ class Lcm:
                 task = asyncio.ensure_future(self.ns.scale(nsr_id, nslcmop_id))
                 self.lcm_tasks.register("ns", nsr_id, nslcmop_id, "ns_scale", task)
                 return
+            elif command == "migrate":
+                nslcmop = params
+                nslcmop_id = nslcmop["_id"]
+                nsr_id = nslcmop["nsInstanceId"]
+                task = asyncio.ensure_future(self.ns.migrate(nsr_id, nslcmop_id))
+                self.lcm_tasks.register("ns", nsr_id, nslcmop_id, "ns_migrate", task)
+                return
             elif command == "show":
                 nsr_id = params
                 try:
@@ -470,12 +485,17 @@ class Lcm:
             elif command == "deleted":
                 return  # TODO cleaning of task just in case should be done
             elif command in (
+                "vnf_terminated",
+                "policy_updated",
                 "terminated",
                 "instantiated",
                 "scaled",
                 "actioned",
+                "updated",
+                "migrated",
             ):  # "scaled-cooldown-time"
                 return
+
         elif topic == "nsi":  # netslice LCM processes (instantiate, terminate, etc)
             if command == "instantiate":
                 # self.logger.debug("Instantiating Network Slice {}".format(nsilcmop["netsliceInstanceId"]))
@@ -671,9 +691,7 @@ class Lcm:
         # check RO version
         self.loop.run_until_complete(self.check_RO_version())
 
-        self.ns = ns.NsLcm(
-            self.msg, self.lcm_tasks, self.config, self.loop
-        )
+        self.ns = ns.NsLcm(self.msg, self.lcm_tasks, self.config, self.loop)
         self.netslice = netslice.NetsliceLcm(
             self.msg, self.lcm_tasks, self.config, self.loop, self.ns
         )