diff options
author | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2016-04-20 14:52:31 +0100 |
---|---|---|
committer | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2016-04-20 14:52:31 +0100 |
commit | 28792b9c11d99388f7038d71ba069d69fbb03823 (patch) | |
tree | a118dd23eedcdb46b8d491a8aa19ce072032fd97 /kbas | |
parent | 22b7b3b7550285544c605ab8ee53a92dc235613b (diff) | |
download | ybd-28792b9c11d99388f7038d71ba069d69fbb03823.tar.gz |
Fixes #205, but how come it was working in general?
Diffstat (limited to 'kbas')
-rwxr-xr-x | kbas/__main__.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kbas/__main__.py b/kbas/__main__.py index 534b581..1b111d1 100755 --- a/kbas/__main__.py +++ b/kbas/__main__.py @@ -140,9 +140,10 @@ class KeyedBinaryArtifactServer(object): try: upload = request.files.get('file') artifact = os.path.join(tmpdir, cache_id) - upload.save(artifact) + with open(artifact, "w") as f: + f.write(upload.value) if call(['tar', 'tf', artifact]): - app.log(this, 'ERROR: not a valid tarfile:', artifact) + app.log('UPLOAD', 'ERROR: not a valid tarfile:', artifact) raise checksum = cache.md5(artifact) with open(artifact + '.md5', "a") as f: @@ -154,11 +155,13 @@ class KeyedBinaryArtifactServer(object): return except: # something went wrong, clean up + import traceback + traceback.print_exc() try: shutil.rmtree(tmpdir) except: pass - response.status = 999 + response.status = 500 return |