summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-06-16 12:24:51 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-06-16 12:24:51 +0100
commit22abdfef781b98f3638c263a590931fa57825c1d (patch)
tree3916c1deece33d50f00745495ec6bc72ce3f05b1
parentd9be3c69242ff44fd8af05cf4b0bc7f8fe41d691 (diff)
parentc1164a88d9b07d165ff5eed6c8026be8241beb64 (diff)
downloadmorph-22abdfef781b98f3638c263a590931fa57825c1d.tar.gz
Merge remote-tracking branch 'origin/sam/distbuild-gc-fix'
Reviewed-By: Lars Wirzenius <lars.wirzenius@codethink.co.uk>
-rw-r--r--morphlib/plugins/gc_plugin.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/morphlib/plugins/gc_plugin.py b/morphlib/plugins/gc_plugin.py
index 43de173e..68f386eb 100644
--- a/morphlib/plugins/gc_plugin.py
+++ b/morphlib/plugins/gc_plugin.py
@@ -79,6 +79,8 @@ class GCPlugin(cliapp.Plugin):
self.cleanup_cachedir(cachedir, cachedir_min_space)
def cleanup_tempdir(self, temp_path, min_space):
+ # The subdirectories in tempdir are created at Morph startup time. Code
+ # assumes that they exist in various places.
self.app.status(msg='Cleaning up temp dir %(temp_path)s',
temp_path=temp_path, chatty=True)
for subdir in ('deployments', 'failed', 'chunks'):
@@ -93,6 +95,7 @@ class GCPlugin(cliapp.Plugin):
path = os.path.join(temp_path, subdir)
if os.path.exists(path):
shutil.rmtree(path)
+ os.mkdir(path)
def calculate_delete_range(self):
now = time.time()