mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 11:50:42 -03:30
Merge pull request #9892 from ryanpetrello/record-unit-id
record the receptor unit ID on the job record for debugging purposes see: #8641 Reviewed-by: Shane McDonald <me@shanemcd.com>
This commit is contained in:
commit
e67923382a
@ -1394,6 +1394,7 @@ class BaseTask(object):
|
||||
)
|
||||
else:
|
||||
receptor_job = AWXReceptorJob(self, params)
|
||||
self.unit_id = receptor_job.unit_id
|
||||
res = receptor_job.run()
|
||||
|
||||
if not res:
|
||||
@ -3069,6 +3070,11 @@ class AWXReceptorJob:
|
||||
if self.task.cancel_callback():
|
||||
result = namedtuple('result', ['status', 'rc'])
|
||||
return result('canceled', 1)
|
||||
|
||||
if hasattr(self, 'unit_id') and 'RECEPTOR_UNIT_ID' not in self.task.instance.job_env:
|
||||
self.task.instance.job_env['RECEPTOR_UNIT_ID'] = self.unit_id
|
||||
self.task.update_model(self.task.instance.pk, job_env=self.task.instance.job_env)
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
@property
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user