summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2015-10-15 14:38:55 +0100
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2015-10-15 14:38:55 +0100
commitaa504e79d622f4a30f7d0042ba8408e71d39268d (patch)
tree2fb088da49e577e878eeeeea974c671447c09205
parenta804435a4b62e3784415998dbe4c4ccaf69bb359 (diff)
downloadybd-nested-tmp.tar.gz
Try nesting tmpnested-tmp
-rw-r--r--ybd/app.py6
-rw-r--r--ybd/assembly.py1
2 files changed, 7 insertions, 0 deletions
diff --git a/ybd/app.py b/ybd/app.py
index bd94577..d286012 100644
--- a/ybd/app.py
+++ b/ybd/app.py
@@ -196,8 +196,14 @@ def elapsed(starttime):
def spawn():
+ import tempfile
+ tempfile.tempdir = app.config['tmp']
for fork in range(1, config.get('instances')):
if os.fork() == 0:
config['fork'] = fork
log('FORKS', 'I am fork', config.get('fork'))
+ tmpdir = tempfile.mkdtemp()
+ app.config['tmp'] = tmpdir
break
+ tmpdir = tempfile.mkdtemp()
+ app.config['tmp'] = tmpdir
diff --git a/ybd/assembly.py b/ybd/assembly.py
index 0e3cb3e..a4125d1 100644
--- a/ybd/assembly.py
+++ b/ybd/assembly.py
@@ -39,6 +39,7 @@ class RetryException(Exception):
str(l.fileno())])
app.config['last-retry'] = datetime.datetime.now()
app.config['last-retry-component'] = component
+ shutil.rmtree(os.path.join(config['tmp']))
pass