Avoid ugly formatting due to a long if statement
This commit is contained in:
parent
a075ec9831
commit
c24f6f438b
1 changed files with 6 additions and 5 deletions
|
@ -573,11 +573,12 @@ class PlayBook(object):
|
||||||
|
|
||||||
host_list = self._list_available_hosts(play.hosts)
|
host_list = self._list_available_hosts(play.hosts)
|
||||||
|
|
||||||
# If threshold for max nodes failed is exceeded or if any_errors_fatal is true, bail out.
|
# Set max_fail_pct to 0, So if any hosts fails, bail out
|
||||||
if (
|
if task.any_errors_fatal and len(host_list) < hosts_count:
|
||||||
(task.any_errors_fatal and len(host_list) < hosts_count) or
|
play.max_fail_pct = 0
|
||||||
((hosts_count - len(host_list)) > int((play.max_fail_pct)/100.0 * hosts_count))
|
|
||||||
):
|
# 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
|
host_list = None
|
||||||
|
|
||||||
# if no hosts remain, drop out
|
# if no hosts remain, drop out
|
||||||
|
|
Loading…
Reference in a new issue