From 5ca9becdf9a254588d6e5c5899c1c782d284b411 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Wed, 15 Jun 2016 11:08:31 +0200 Subject: [PATCH] Do not crash if we can not cleanup a temporay project Fix #576 --- gns3server/modules/project.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gns3server/modules/project.py b/gns3server/modules/project.py index eeee6c0a..f14b74df 100644 --- a/gns3server/modules/project.py +++ b/gns3server/modules/project.py @@ -434,7 +434,10 @@ class Project: path = os.path.join(directory, project) if os.path.exists(os.path.join(path, ".gns3_temporary")): log.warning("Purge old temporary project {}".format(project)) - shutil.rmtree(path) + try: + shutil.rmtree(path) + except OSError as e: + log.error("Error when cleaning {}: {}".format(path, str(e))) def modules(self): """