Avoid ugly formatting due to a long if statement

This commit is contained in:
Kavin Kankeshwar 2013-09-06 22:37:17 -07:00
parent a075ec9831
commit c24f6f438b

View file

@ -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