mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Addresses #4407 Caculate failed percentage based on serial and number of hosts in play
This commit is contained in:
parent
d0cbb51170
commit
5b3b9ba267
1 changed files with 8 additions and 2 deletions
|
@ -674,8 +674,14 @@ class PlayBook(object):
|
|||
play.max_fail_pct = 0
|
||||
|
||||
# If threshold for max nodes failed is exceeded , bail out.
|
||||
if (hosts_count - len(host_list)) > int((play.max_fail_pct)/100.0 * hosts_count):
|
||||
host_list = None
|
||||
if play.serial > 0:
|
||||
# if serial is set, we need to shorten the size of host_count
|
||||
play_count = len(play._play_hosts)
|
||||
if (play_count - len(host_list)) > int((play.max_fail_pct)/100.0 * play_count):
|
||||
host_list = None
|
||||
else:
|
||||
if (hosts_count - len(host_list)) > int((play.max_fail_pct)/100.0 * hosts_count):
|
||||
host_list = None
|
||||
|
||||
# if no hosts remain, drop out
|
||||
if not host_list:
|
||||
|
|
Loading…
Reference in a new issue