diff options
author | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2014-04-04 19:18:47 +0100 |
---|---|---|
committer | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2014-04-04 19:18:47 +0100 |
commit | d4e4827a56f35ee53e1771ef3acfb82935428bbf (patch) | |
tree | c60d9bcee2efbb91f301341f8e752e7a063e15ce /morph-cache-server | |
parent | 1572c3015f4aead481140fde85807ec341bbd130 (diff) | |
download | morph-cache-server-d4e4827a56f35ee53e1771ef3acfb82935428bbf.tar.gz |
We don't not need no form
Diffstat (limited to 'morph-cache-server')
-rwxr-xr-x | morph-cache-server | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/morph-cache-server b/morph-cache-server index ad102bf..c0c23f5 100755 --- a/morph-cache-server +++ b/morph-cache-server @@ -304,20 +304,12 @@ class MorphCacheServer(cliapp.Application): response.status = 404 logging.debug('artifact %s does not exist' % basename) - @app.get('/postartifacts') - def artifact(): - return ''' - <form action="/postartifacts" method="post"> - artifacts: <input name="artifacts" type="text" /> - </form> - ''' - - @app.post('/postartifacts') - def do_artifacts(): + @app.post('/artifacts') + def post_artifacts(): artifacts = request.forms.get('artifacts').split(',') results = {} - logging.debug('Received a POST request for /postartifacts') + logging.debug('Received a POST request for /artifacts') for artifact in artifacts: logging.debug('Checking whether artifact %s is in the cache' @@ -326,6 +318,8 @@ class MorphCacheServer(cliapp.Application): filename = os.path.join(self.settings['artifact-dir'], basename) results[artifact] = os.path.exists(filename) + logging.debug('%s is%s in the cache' % + (artifact, '' if result[artifact] else "n't")) return results |