+ self.vlr_uptime_tasks[vlr.id] = self._loop.create_task(self.vlr_uptime_update(vlr))
+
+
+ def vlr_uptime_update(self, vlr):
+ try:
+
+ vlr_ = RwVlrYang.YangData_Vlr_VlrCatalog_Vlr.from_dict({'id': vlr.id})
+ while True:
+ vlr_.uptime = int(time.time()) - vlr._create_time
+ yield from self._vlr_handler.update(None, VirtualLinkRecord.vlr_xpath(vlr), vlr_)
+ yield from asyncio.sleep(2, loop=self._loop)
+ except asyncio.CancelledError:
+ self._log.debug("Received cancellation request for vlr_uptime_update task")
+ yield from self._vlr_handler.delete(None, VirtualLinkRecord.vlr_xpath(vlr))
+