mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Delete a project
This commit is contained in:
1 parent
9a0b260c56
commit
986a7f55ef
4 files changed
+54
-2
No files matched your search
@@ -98,10 +98,23 @@ class Project:
|
||||
"location": self._location
|
||||
}
|
||||
|
||||
def close(self):
|
||||
"""Close the project, but keep informations on disk"""
|
||||
|
||||
pass
|
||||
|
||||
def commit(self):
|
||||
"""Write project changes on disk"""
|
||||
|
||||
while self._vms_to_destroy:
|
||||
vm = self._vms_to_destroy.pop()
|
||||
directory = self.vm_working_directory(vm)
|
||||
if os.path.exists(directory):
|
||||
shutil.rmtree(directory)
|
||||
|
||||
def delete(self):
|
||||
"""Remove project from disk"""
|
||||
|
||||
self.close()
|
||||
if os.path.exists(self.path):
|
||||
shutil.rmtree(self.path)
|
||||
Reference in new issue
Block a user