Merge pull request #213 from jmchilton/job_files_fix

[STABLE] Job file API fixes
This commit is contained in:
Dannon Baker
2015-05-05 09:22:51 -04:00
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -342,7 +342,7 @@ class PulsarJobRunner( AsynchronousJobRunner ):
encoded_job_id = self.app.security.encode_id(job_id)
job_key = self.app.security.encode_id( job_id, kind="jobs_files" )
endpoint_base = "%s/api/jobs/%s?job_key=%s"
endpoint_base = "%s/api/jobs/%s/files?job_key=%s"
if self.app.config.nginx_upload_job_files_path:
endpoint_base = "%s" + \
self.app.config.nginx_upload_job_files_path + \
+6 -1
View File
@@ -99,7 +99,12 @@ class JobFilesAPIController( BaseAPIController ):
try:
shutil.move( input_file.name, path )
finally:
input_file.close()
try:
input_file.close()
except OSError:
# Fails to close file if not using nginx upload because the
# tempfile has moved and Python wants to delete it.
pass
return {"message": "ok"}
def __authorize_job_access(self, trans, encoded_job_id, **kwargs):