From b6f6a551dd77df3aac18ec13d253e53b17ed2fa0 Mon Sep 17 00:00:00 2001 From: Paul Sherwood Date: Fri, 8 Jul 2016 08:54:19 +0100 Subject: [PATCH] Exit if unpack fails - it's no good continuing --- ybd/cache.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ybd/cache.py b/ybd/cache.py index 97695d5..3a1ef2c 100644 --- a/ybd/cache.py +++ b/ybd/cache.py @@ -182,9 +182,7 @@ def unpack(dn, tmpfile): unpackdir = tmpfile + '.unpacked' os.makedirs(unpackdir) if call(['tar', 'xf', tmpfile, '--directory', unpackdir]): - app.log(dn, 'Problem unpacking', tmpfile) - shutil.rmtree(os.path.dirname(tmpfile)) - return False + app.log(dn, 'WARNING: Problem unpacking', tmpfile, exit=True) try: path = os.path.join(app.config['artifacts'], cache_key(dn))