Skip to content

Commit

Permalink
feat: do not count dark hosts as updated
Browse files Browse the repository at this point in the history
  • Loading branch information
pb82 committed Mar 5, 2025
1 parent 7b8b37d commit fd0088b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion awx/main/models/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,6 @@ def _update_host_summary_from_stats(self, hostnames):
summaries = dict()
updated_hosts_list = list()
for host in hostnames:
updated_hosts_list.append(host.lower())
host_id = host_map.get(host)
if host_id not in existing_host_ids:
host_id = None
Expand All @@ -582,6 +581,12 @@ def _update_host_summary_from_stats(self, hostnames):
summary.failed = bool(summary.dark or summary.failures)
summaries[(host_id, host)] = summary

# do not count dark / unreachable hosts as updated
if not bool(summary.dark):
updated_hosts_list.append(host.lower())
else:
logger.error(f'host {host.lower()} is dark / unreachable, not marking it as updated')

JobHostSummary.objects.bulk_create(summaries.values())

# update the last_job_id and last_job_host_summary_id
Expand Down

0 comments on commit fd0088b

Please sign in to comment.