return
elif topic == "vim_account":
vim_id = params["_id"]
- if command == "create" or command == "created":
+ 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
print("not implemented show with vim_account")
sys.stdout.flush()
return
- elif command == "edit" or command == "edited":
+ 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" or command == "created":
+ 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
print("not implemented show with wim_account")
sys.stdout.flush()
return
- elif command == "edit" or command == "edited":
+ 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" or command == "created":
+ 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
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" or command == "edited":
+ 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):
# and not parse integer or boolean
try:
with open(config_file) as f:
- conf = yaml.load(f)
+ conf = yaml.load(f, Loader=yaml.Loader)
for k, v in environ.items():
if not k.startswith("OSMLCM_"):
continue
if __name__ == '__main__':
try:
+ print("SYS.PATH='{}'".format(sys.path))
# load parameters and configuration
# -h
# -c value