From cd8a2b4e2e31e353df1093ea0d07ca08cc912d20 Mon Sep 17 00:00:00 2001 From: Nils Homer Date: Thu, 11 Jun 2020 12:33:38 -0700 Subject: [PATCH] set the job id after submission --- pyfgaws/batch/api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyfgaws/batch/api.py b/pyfgaws/batch/api.py index ae7e82d..ff4b994 100644 --- a/pyfgaws/batch/api.py +++ b/pyfgaws/batch/api.py @@ -279,7 +279,7 @@ def add_to_kwargs(key: str, value: Optional[Any]) -> None: add_to_kwargs(key="retryStrategy", value=self.retry_strategy) add_to_kwargs(key="timeout", value=self.timeout) - return self.client.submit_job( + response = self.client.submit_job( jobName=self.name, jobQueue=self.queue, jobDefinition=self.job_definition_arn, @@ -293,6 +293,11 @@ def add_to_kwargs(key: str, value: Optional[Any]) -> None: # timeout=None, ) + # Don't forget to set the job id + self.job_id = response["jobId"] + + return response + def _reason(self, reason: Optional[str] = None) -> str: """The default reason for cancelling or terminating a job""" return reason if reason is not None else "manually initiated"