mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
Add failed_when module variable.
Implementation note: Ternery operator trick for python prior to 2.5 is used. (test and [when_true_value] or [when_false_value])[0] http://stackoverflow.com/questions/394809/ternary-conditional-operator-in-python#comment1466794_394887
This commit is contained in:
parent
808d9596b2
commit
2357194b39
6 changed files with 61 additions and 8 deletions
|
@ -189,7 +189,7 @@ class AggregateStats(object):
|
|||
|
||||
for (host, value) in runner_results.get('contacted', {}).iteritems():
|
||||
if not ignore_errors and (('failed' in value and bool(value['failed'])) or
|
||||
('rc' in value and value['rc'] != 0)):
|
||||
('failed_when_result' in value and [value['failed_when_result']] or ['rc' in value and value['rc'] != 0])[0]):
|
||||
self._increment('failures', host)
|
||||
elif 'skipped' in value and bool(value['skipped']):
|
||||
self._increment('skipped', host)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue