summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2016-04-09 19:20:49 +0100
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2016-04-09 20:15:14 +0100
commitb0ce7a6fd333ffdd0331efab044b52bd19fb36a0 (patch)
treea11caabfba3f50e823f046ddee154bd20707929c
parent120fcecdf582f5bb6ceb42a858f0b5689c8773fd (diff)
downloadybd-b0ce7a6fd333ffdd0331efab044b52bd19fb36a0.tar.gz
Fixes #197 don't remove sandbox dir if an exception happens
-rw-r--r--ybd/sandbox.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/ybd/sandbox.py b/ybd/sandbox.py
index 989b69a..44ef76f 100644
--- a/ybd/sandbox.py
+++ b/ybd/sandbox.py
@@ -58,10 +58,19 @@ def setup(this):
try:
yield
+ except app.RetryException as e:
+ raise e
+ except:
+ import traceback
+ app.log(this, 'ERROR: a surprise exception happened', '')
+ traceback.print_exc()
+ app.exit(this, 'ERROR: sandbox debris is at', this['sandbox'])
finally:
- if app.config.get('log-verbose'):
- app.log(this, "Removing sandbox dir", this['sandbox'])
- app.remove_dir(this['sandbox'])
+ pass
+
+ if app.config.get('log-verbose'):
+ app.log(this, "Removing sandbox dir", this['sandbox'])
+ app.remove_dir(this['sandbox'])
def install(defs, this, component):