remove log file when stopping instance

This commit is contained in:
mantaohuang 2020-04-03 22:52:16 -04:00
parent f7da682e33
commit e247f04bab

View File

@ -101,6 +101,10 @@ class Openvpn:
self.status = IDLE self.status = IDLE
self.run_task.cancel() self.run_task.cancel()
try:
os.remove(self.log_fp)
except Exception as err:
print("cannot remove log file, error:", err)
async def restart(self): async def restart(self):
await self.stop() await self.stop()