diff --git a/src/jupyter_remote/remote.py b/src/jupyter_remote/remote.py index d033ae50efad584c2cdccdb79bfd1e8b8d1fae58..6070416547f9ec916319ed7127c0a807992891f2 100644 --- a/src/jupyter_remote/remote.py +++ b/src/jupyter_remote/remote.py @@ -88,15 +88,15 @@ def wait_for_pod(v1, name, ns, max_wait=60): def wait_for_job(v1, name, ns, max_wait=60): resp = v1.read_namespaced_job(name=name, namespace=ns) print(resp.status) - active_status = resp.status.active - ready_status = resp.status.ready + active_status = resp.status.active if resp.status.active else 0 + ready_status = resp.status.ready if resp.status.ready else 0 i = 0 while active_status+ready_status != 2 and i < max_wait: print("Waiting...") time.sleep(1) resp = v1.read_namespaced_job(name=name, namespace=ns) - active_status = resp.status.active - ready_status = resp.status.ready + active_status = resp.status.active if resp.status.active else 0 + ready_status = resp.status.ready if resp.status.ready else 0 i += 1 for status_condition in resp.status.conditions: try: