summaryrefslogtreecommitdiff
path: root/kbas
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2016-03-10 11:56:05 +0000
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2016-03-10 11:59:33 +0000
commit57a3777052039628cc92917705400f1b202db289 (patch)
tree6d1b35e332877ad4c7ed413f8fba1c64b105958c /kbas
parent0d5e8f5a426e5ed00aaf79c33cff30a7638106f3 (diff)
downloadybd-57a3777052039628cc92917705400f1b202db289.tar.gz
Use tar -tf to check artifact, instead of -xf
Diffstat (limited to 'kbas')
-rwxr-xr-xkbas/__main__.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/kbas/__main__.py b/kbas/__main__.py
index 3879cb7..55100c3 100755
--- a/kbas/__main__.py
+++ b/kbas/__main__.py
@@ -134,12 +134,9 @@ class KeyedBinaryArtifactServer(object):
upload = request.files.get('file')
artifact = os.path.join(tmpdir, cache_id)
upload.save(artifact)
- unpackdir = artifact + '.unpacked'
- os.makedirs(unpackdir)
- if call(['tar', 'xf', artifact, '--directory', unpackdir]):
- app.log(this, 'ERROR: Problem unpacking', artifact)
+ if call(['tar', 'tf', artifact]):
+ app.log(this, 'ERROR: not a valid tarfile:', artifact)
raise
- shutil.rmtree(unpackdir)
checksum = cache.md5(artifact)
with open(artifact + '.md5', "a") as f:
f.write(checksum)