Skip to content

Commit

Permalink
fixed error on /compute/post when uploading a file
Browse files Browse the repository at this point in the history
  • Loading branch information
jdorsch committed Feb 13, 2024
1 parent 36d14a1 commit 610d4a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Fixed demo images dependency declarations preventing docker-compose to build successfully.
- Fixed check when submitted an empty batch file on `POST /compute/jobs/upload`
- Fixed error message when `GET /status/systems` encounters error in one filesystem


## [1.14.0]
Expand Down
6 changes: 6 additions & 0 deletions src/compute/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,12 @@ def submit_job_upload():
app.logger.error('No batch file selected')
error = jsonify(description="Failed to submit job file", error='No batch file selected')
return error, 400

if job_file['content'] == '':
app.logger.error('Batch file is empty')
error = jsonify(description="Failed to submit job file", error='Batch file is empty')
return error, 400


except RequestEntityTooLarge as re:
app.logger.error(re.description)
Expand Down
4 changes: 2 additions & 2 deletions src/status/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ def status_systems():
#
if status == -5:
reason = res["reason"]
ret_dict={"system":machinename, "status":"not available", "description": f"Error on JWT token: {reason}"}
ret_dict={"system": system, "status":"not available", "description": f"Error on JWT token: {reason}"}
if status == -4:
filesystem = res["filesystem"]
ret_dict={"system":machinename, "status":"not available", "description": f"Filesystem {filesystem} is not available"}
ret_dict={"system": system, "status":"not available", "description": f"Filesystem {filesystem} is not available"}
elif status == -2:
ret_dict = {"system": system, "status": "not available", "description": "System down"}
elif status == -1:
Expand Down

0 comments on commit 610d4a9

Please sign in to comment.