-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specific message when canceling an already canceled job #15
Conversation
What happened when someone cancelled an already cancelled job before you made these changes? |
Checkout #3 |
ingestclient/client.py
Outdated
@@ -229,6 +229,15 @@ def main(configuration=None, parser_args=None): | |||
|
|||
if args.cancel: | |||
# Trying to cancel | |||
boss_backend_params = {"client": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've hardcoded the backend properties. We'll need to pull them from the json file passed in on the commandline.
@sandyhider you were right, I also realized that when not specifying an config file and defaulting to our production boss, I hadn't included the message. So I added that as well. |
@@ -479,6 +479,8 @@ def get_job_status(self, ingest_job_id): | |||
r = requests.get('{}/{}/ingest/{}/status'.format(self.host, self.api_version, ingest_job_id), | |||
headers=self.api_headers, verify=self.validate_ssl) | |||
|
|||
if r.text == '{"status": 404, "code": 2004, "message": "The job with id %s has been deleted"}' % (ingest_job_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should fix the response from the endpoint so it returns a normal 200 with the status set properly instead of a 404. Currently, we don't match our docs when getting status for a deleted job: https://theboss.readme.io/docs/get-ingest-job-status
Then in client.py, you can do a normal get_job_status()
call.
Fix would be here: https://github.com/jhuapl-boss/boss/blob/08a0ddb86b7dedf1c0b029d9479db0dc2b11ff1a/django/bossingest/views.py#L362
This fixes #3
If job is already canceled an appropriate message will be displayed.
(Did this really quickly since I noticed the issue)