diff --git a/pygenie/adapter/genie_2.py b/pygenie/adapter/genie_2.py index 728f524..5b4a3f0 100644 --- a/pygenie/adapter/genie_2.py +++ b/pygenie/adapter/genie_2.py @@ -252,7 +252,7 @@ def get_genie_log(self, job_id, **kwargs): def get_status(self, job_id): """Get job status.""" - return self.get(job_id, path='status', timeout=10).get('status') + return self.get(job_id, path='status', timeout=10).get('status').upper() def get_stderr(self, job_id, **kwargs): """Get a stderr log for a job.""" diff --git a/pygenie/adapter/genie_3.py b/pygenie/adapter/genie_3.py index 6a88233..a994bff 100644 --- a/pygenie/adapter/genie_3.py +++ b/pygenie/adapter/genie_3.py @@ -380,7 +380,7 @@ def get_status(self, job_id, timeout=10): return self.get(job_id, path='status', timeout=None if self.disable_timeout else timeout) \ - .get('status') + .get('status').upper() def get_stderr(self, job_id, **kwargs): """Get a stderr log for a job.""" diff --git a/pygenie/jobs/running.py b/pygenie/jobs/running.py index c611ce8..4cd6f40 100644 --- a/pygenie/jobs/running.py +++ b/pygenie/jobs/running.py @@ -26,8 +26,10 @@ RUNNING_STATUSES = { 'INIT', 'RUNNING', - 'init', - 'running' + 'RESERVED', + 'ACCEPTED', + 'RESOLVED', + 'CLAIMED' } INFO_SECTIONS = { @@ -263,7 +265,7 @@ def finish_time(self): int: The finish time in epoch (milliseconds). """ - status = self.status + status = self.status.upper() if ('finished' not in self.info) \ or status in RUNNING_STATUSES \ @@ -587,7 +589,7 @@ def status(self): str: Job status. """ if self._status is None and self.info.get('status'): - self._status = self.info.get('status') + self._status = self.info.get('status').upper() if (self._status is None) or (self._status in RUNNING_STATUSES): last_known_status = self._status