diff options
author | Daniel Firth <dan.firth@codethink.co.uk> | 2016-11-29 13:01:14 +0000 |
---|---|---|
committer | Daniel Firth <dan.firth@codethink.co.uk> | 2016-11-29 13:01:14 +0000 |
commit | 54aff1da1ea84c78e768681157f053c753c4df36 (patch) | |
tree | c323b4dc3296fd5b7c7f698bb0634f1964149c62 /kbas | |
parent | a53b5fd06a392a7d4ce8b03a5416114ad3726faf (diff) | |
download | ybd-54aff1da1ea84c78e768681157f053c753c4df36.tar.gz |
Revert "Move chdir, timer to utils; fix circular deps"
This reverts commit c3d414dd1fd062dafe0806851094a953530a7fdd.
Diffstat (limited to 'kbas')
-rwxr-xr-x | kbas/__main__.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/kbas/__main__.py b/kbas/__main__.py index 3eecd89..204c7b9 100755 --- a/kbas/__main__.py +++ b/kbas/__main__.py @@ -86,15 +86,14 @@ class KeyedBinaryArtifactServer(object): @bottle.get('/1.0/artifacts') def get_morph_artifact(): f = request.query.filename - return static_file(f, root=config.config['artifact-dir'], - download=True) + return static_file(f, root=config.config['artifact-dir'], download=True) @bottle.get('/get/<cache_id>') def get_artifact(cache_id): f = os.path.join(cache_id, cache_id) config.config['downloads'] += 1 - return static_file(f, root=config.config['artifact-dir'], - download=True, mimetype='application/x-tar') + return static_file(f, root=config.config['artifact-dir'], download=True, + mimetype='application/x-tar') @bottle.get('/') @bottle.get('/status') @@ -104,8 +103,7 @@ class KeyedBinaryArtifactServer(object): artifacts = len(os.listdir(config.config['artifact-dir'])) started = config.config['start-time'].strftime('%y-%m-%d %H:%M:%S') downloads = config.config['downloads'] - last_upload = config.config['last-upload'].strftime( - '%y-%m-%d %H:%M:%S') + last_upload = config.config['last-upload'].strftime('%y-%m-%d %H:%M:%S') content = [['Started:', started, None]] content += [['Last upload:', last_upload, None]] if config.config.get('last-reject'): @@ -133,8 +131,7 @@ class KeyedBinaryArtifactServer(object): response.status = 400 # bad request, cache_id contains bad things return - if os.path.isdir(os.path.join(config.config['artifact-dir'], - cache_id)): + if os.path.isdir(os.path.join(config.config['artifact-dir'], cache_id)): if cache.check(cache_id) == request.forms.get('checksum', 'XYZ'): response.status = 777 # this is the same binary we have return |