Skip to content

Commit

Permalink
Merge branch 'RESTAPI-921-issue-on-error-in-status-systems' into 'mas…
Browse files Browse the repository at this point in the history
…ter'

Restapi 921 issue on error in status systems

See merge request firecrest/firecrest!271
  • Loading branch information
Juan Pablo Dorsch committed Feb 14, 2024
2 parents 36d14a1 + fddfd3b commit 61e4a62
Show file tree
Hide file tree
Showing 3 changed files with 11 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
7 changes: 7 additions & 0 deletions src/compute/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,13 @@ 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

# decoding content, since from read() method it returns binary encoding
if job_file['content'].decode() == '':
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 61e4a62

Please sign in to comment.