- if vca_deployed: # TODO it would be desirable having a and deploy_info.get("deployed"):
- task = asyncio.ensure_future(
- self.n2vc.RemoveCharms(
- vca_deployed['model'],
- vca_deployed["application"],
- # self.n2vc_callback,
- # db_nsr,
- # db_nslcmop,
- )
- )
- vca_application_name2index[vca_deployed["application"]] = vca_index
- vca_task_list.append(task)
- vca_task_dict[vca_deployed["application"]] = task
- # task.add_done_callback(functools.partial(self.n2vc_callback, vca_deployed['model'],
- # vca_deployed['application'], None, db_nsr,
- # db_nslcmop, vnf_index))
- self.lcm_tasks.register("ns", nsr_id, nslcmop_id,
- "delete_charm:" + vca_deployed["application"], task)
+ if vca_deployed:
+ if await self._destroy_charm(vca_deployed['model'], vca_deployed["application"]):
+ vca_deployed.clear()
+ db_nsr["_admin.deployed.VCA.{}".format(vca_index)] = None
+ else:
+ vca_time_destroy = time()