Only use known stats keys for determining hostnames to use for job host summaries.

This commit is contained in:
Chris Church 2016-12-14 15:12:27 -05:00
parent 4b87e0a80d
commit 2988ac1904

View File

@ -1073,8 +1073,8 @@ class JobEvent(CreatedModifiedModel):
from awx.main.models.inventory import Host
hostnames = set()
try:
for v in self.event_data.values():
hostnames.update(v.keys())
for stat in ('changed', 'dark', 'failures', 'ok', 'processed', 'skipped'):
hostnames.update(self.event_data.get(stat, {}).keys())
except AttributeError: # In case event_data or v isn't a dict.
pass
with ignore_inventory_computed_fields():