From 4d6d0e96c6418f68b9fa3eb69f3d32764dd549d6 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 30 Sep 2016 10:47:37 +0200 Subject: [PATCH] Fix crash if you manually delete the project directory and use the delete button in interface Fix #697 --- gns3server/controller/project.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gns3server/controller/project.py b/gns3server/controller/project.py index 9522638d..6ce88470 100644 --- a/gns3server/controller/project.py +++ b/gns3server/controller/project.py @@ -564,7 +564,10 @@ class Project: if self._status == "opened": yield from self.close() yield from self.delete_on_computes() - shutil.rmtree(self.path) + try: + shutil.rmtree(self.path) + except OSError as e: + raise aiohttp.web.HTTPConflict(text="Can not delete project directory {}: {}".format(self.path, str(e))) @asyncio.coroutine def delete_on_computes(self):