mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Keep result pristine for ignore_errors
This commit is contained in:
@@ -76,11 +76,12 @@ class AggregateStats(object):
|
||||
prev = (getattr(self, what)).get(host, 0)
|
||||
getattr(self, what)[host] = prev+1
|
||||
|
||||
def compute(self, runner_results, setup=False, poll=False):
|
||||
def compute(self, runner_results, setup=False, poll=False, ignore_errors=False):
|
||||
''' walk through all results and increment stats '''
|
||||
|
||||
for (host, value) in runner_results.get('contacted', {}).iteritems():
|
||||
if ('failed' in value and bool(value['failed'])) or ('rc' in value and value['rc'] != 0):
|
||||
if not ignore_errors and (('failed' in value and bool(value['failed'])) or
|
||||
('rc' in value and value['rc'] != 0)):
|
||||
self._increment('failures', host)
|
||||
elif 'skipped' in value and bool(value['skipped']):
|
||||
self._increment('skipped', host)
|
||||
|
||||
Reference in New Issue
Block a user