mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 05:29:26 -02:30
Work on AC-205. Update display of extra events triggered by async polling.
This commit is contained in:
@@ -898,8 +898,10 @@ class JobEventAccess(BaseAccess):
|
|||||||
return qs
|
return qs
|
||||||
job_qs = self.user.get_queryset(Job)
|
job_qs = self.user.get_queryset(Job)
|
||||||
host_qs = self.user.get_queryset(Host)
|
host_qs = self.user.get_queryset(Host)
|
||||||
return qs.filter(Q(host__isnull=True) | Q(host__in=host_qs),
|
qs = qs.filter(Q(host__isnull=True) | Q(host__in=host_qs),
|
||||||
job__in=job_qs)
|
job__in=job_qs)
|
||||||
|
# FIXME: Filter certain extra events from async polling?
|
||||||
|
return qs
|
||||||
|
|
||||||
def can_add(self, data):
|
def can_add(self, data):
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -1139,6 +1139,24 @@ class JobEvent(models.Model):
|
|||||||
elif self.event == 'playbook_on_task_start':
|
elif self.event == 'playbook_on_task_start':
|
||||||
if self.task is not None:
|
if self.task is not None:
|
||||||
msg = "%s (%s)" % (msg, self.task)
|
msg = "%s (%s)" % (msg, self.task)
|
||||||
|
|
||||||
|
# Change display for runner events trigged by async polling.
|
||||||
|
if self.event in ('runner_on_ok', 'runner_on_failed'):
|
||||||
|
res = self.event_data.get('res', {})
|
||||||
|
try:
|
||||||
|
module_name = res['invocation']['module_name']
|
||||||
|
job_id = res['ansible_job_id']
|
||||||
|
except (TypeError, KeyError, AttributeError):
|
||||||
|
module_name = None
|
||||||
|
job_id = None
|
||||||
|
if module_name and job_id:
|
||||||
|
if module_name == 'async_status':
|
||||||
|
msg = 'Host Async Checking'
|
||||||
|
else:
|
||||||
|
msg = 'Host Async Started'
|
||||||
|
#msg = '%s %s %s' % (msg, module_name, job_id)
|
||||||
|
#msg = '%s [%s]' % (msg, self.event)
|
||||||
|
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def _find_parent(self):
|
def _find_parent(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user