diff --git a/batchspawner/batchspawner.py b/batchspawner/batchspawner.py index d6aeff2..0b981d2 100644 --- a/batchspawner/batchspawner.py +++ b/batchspawner/batchspawner.py @@ -994,7 +994,7 @@ def state_ispending(self): return False status = json.loads(self.job_status) - return status["state"] in ("DEPEND", "PRIORITY", "SCHED") + return status["state"] in ("DEPEND", "PRIORITY", "SCHED") or "uri" not in status def state_isrunning(self): @@ -1002,7 +1002,7 @@ def state_isrunning(self): return False status = json.loads(self.job_status) - return status["state"] in ("RUN", "CLEANUP") + return status["state"] in ("RUN", "CLEANUP") and "uri" in status def state_gethost(self): status = json.loads(self.job_status)