1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-25 00:08:11 +00:00

SIGHUP: remove projects with an empty project directory.

This commit is contained in:
grossmj 2021-02-16 17:00:59 +10:30
parent 0b854ffceb
commit 56c25727b6

View File

@ -148,7 +148,7 @@ class Controller:
# remove all projects deleted from disk. # remove all projects deleted from disk.
for project in self._projects.copy().values(): 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...") log.info(f"Project '{project.name}' doesn't exist on the disk anymore, closing...")
await project.close() await project.close()
self.remove_project(project) self.remove_project(project)