summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2014-04-04 19:18:47 +0100
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2014-04-04 19:18:47 +0100
commitd4e4827a56f35ee53e1771ef3acfb82935428bbf (patch)
treec60d9bcee2efbb91f301341f8e752e7a063e15ce
parent1572c3015f4aead481140fde85807ec341bbd130 (diff)
downloadmorph-cache-server-d4e4827a56f35ee53e1771ef3acfb82935428bbf.tar.gz
We don't not need no form
-rwxr-xr-xmorph-cache-server16
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