Skip to content

Commit

Permalink
Fix dict access
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolan Woods committed Sep 29, 2020
1 parent 27d0052 commit 5264d2d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/galaxy/jobs/runners/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,16 @@ def queue_job(self, job_wrapper):

job = Job(self._pykube_api, k8s_job_obj)
job.create()
job_id = getattr(job.labels, JOB_ID_LABEL, False)
job_id = job.labels.get(JOB_ID_LABEL, False)
if not job_id:
# Recover uid label because it wasn't set
job.labels[JOB_ID_LABEL] = job.metadata.uid
job.update()
job_id = getattr(job.labels, JOB_ID_LABEL, False)
if not job_id:
job_wrapper.fail("Unexpected value from job runner", exception=True)
log.exception("%s not assigned by k8s to job on invocation: %s" % (JOB_ID_LABEL, job.obj))
return
## Recover uid label because it wasn't set
#job.labels[JOB_ID_LABEL] = job.metadata.uid
#job.update()
#job_id = job.labels.get(JOB_ID_LABEL, False)
#if not job_id:
job_wrapper.fail("Unexpected value from job runner", exception=True)
log.exception("%s not assigned by k8s to job on invocation: %s" % (JOB_ID_LABEL, job.obj))
return

# define job attributes in the AsyncronousJobState for follow-up
ajs.job_id = job_id
Expand Down

0 comments on commit 5264d2d

Please sign in to comment.