From f210c1c8a326d56fea613c7c7c1ff3f17dd5901c Mon Sep 17 00:00:00 2001 From: tierno Date: Wed, 16 Oct 2019 09:09:58 +0000 Subject: [PATCH] Bug 864 allows both create/created, edit/edited for VIM,WIM,SDN kafka operation Change-Id: I88deb936138e1f1ee2b350d2f2334ce4e20f5598 Signed-off-by: tierno --- osm_lcm/__init__.py | 4 ++-- osm_lcm/lcm.py | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/osm_lcm/__init__.py b/osm_lcm/__init__.py index 1c51076..b824047 100644 --- a/osm_lcm/__init__.py +++ b/osm_lcm/__init__.py @@ -13,5 +13,5 @@ ## # version moved to lcm.py. uncomment if LCM is installed as library and installed -version = '6.0.2.post2' -version_date = '2018-09-11' +version = '6.0.3.post6' +version_date = '2018-10-16' diff --git a/osm_lcm/lcm.py b/osm_lcm/lcm.py index 48c07eb..274154b 100644 --- a/osm_lcm/lcm.py +++ b/osm_lcm/lcm.py @@ -361,7 +361,7 @@ class Lcm: return elif topic == "vim_account": vim_id = params["_id"] - if command == "create": + if command in ("create", "created"): task = asyncio.ensure_future(self.vim.create(params, order_id)) self.lcm_tasks.register("vim_account", vim_id, order_id, "vim_create", task) return @@ -374,13 +374,15 @@ class Lcm: print("not implemented show with vim_account") sys.stdout.flush() return - elif command == "edit": + elif command in ("edit", "edited"): task = asyncio.ensure_future(self.vim.edit(params, order_id)) self.lcm_tasks.register("vim_account", vim_id, order_id, "vim_edit", task) return + elif command == "deleted": + return # TODO cleaning of task just in case should be done elif topic == "wim_account": wim_id = params["_id"] - if command == "create": + if command in ("create", "created"): task = asyncio.ensure_future(self.wim.create(params, order_id)) self.lcm_tasks.register("wim_account", wim_id, order_id, "wim_create", task) return @@ -393,13 +395,15 @@ class Lcm: print("not implemented show with wim_account") sys.stdout.flush() return - elif command == "edit": + elif command in ("edit", "edited"): task = asyncio.ensure_future(self.wim.edit(params, order_id)) self.lcm_tasks.register("wim_account", wim_id, order_id, "wim_edit", task) return + elif command == "deleted": + return # TODO cleaning of task just in case should be done elif topic == "sdn": _sdn_id = params["_id"] - if command == "create": + if command in ("create", "created"): task = asyncio.ensure_future(self.sdn.create(params, order_id)) self.lcm_tasks.register("sdn", _sdn_id, order_id, "sdn_create", task) return @@ -408,10 +412,12 @@ class Lcm: task = asyncio.ensure_future(self.sdn.delete(params, order_id)) self.lcm_tasks.register("sdn", _sdn_id, order_id, "sdn_delete", task) return - elif command == "edit": + elif command in ("edit", "edited"): task = asyncio.ensure_future(self.sdn.edit(params, order_id)) self.lcm_tasks.register("sdn", _sdn_id, order_id, "sdn_edit", task) return + elif command == "deleted": + return # TODO cleaning of task just in case should be done self.logger.critical("unknown topic {} and command '{}'".format(topic, command)) async def kafka_read(self): -- 2.25.1