From 56c25727b6d31fcf436175699e11c626fbe4d9e6 Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 16 Feb 2021 17:00:59 +1030 Subject: [PATCH] SIGHUP: remove projects with an empty project directory. --- gns3server/controller/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gns3server/controller/__init__.py b/gns3server/controller/__init__.py index 85f0438e..af5b9123 100644 --- a/gns3server/controller/__init__.py +++ b/gns3server/controller/__init__.py @@ -148,7 +148,7 @@ class Controller: # remove all projects deleted from disk. for project in self._projects.copy().values(): - if not os.path.exists(project.path): + if not os.path.exists(project.path) or not os.listdir(project.path): log.info(f"Project '{project.name}' doesn't exist on the disk anymore, closing...") await project.close() self.remove_project(project)