summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKavin Kankeshwar <kavin@citrusleaf.net>2013-09-06 22:37:17 -0700
committerKavin Kankeshwar <kavin@citrusleaf.net>2013-09-06 22:37:17 -0700
commitc24f6f438ba95299f80e2c40a305e6f4ad698f97 (patch)
tree5489dbe4829fe0806083f914f7f7515408208bc6
parenta075ec9831ba1096af41c1d8d20eaf1b8e2909f7 (diff)
downloadansible-c24f6f438ba95299f80e2c40a305e6f4ad698f97.tar.gz
Avoid ugly formatting due to a long if statement
-rw-r--r--lib/ansible/playbook/__init__.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/ansible/playbook/__init__.py b/lib/ansible/playbook/__init__.py
index 0ad9a65c0c..6700e4c3c9 100644
--- a/lib/ansible/playbook/__init__.py
+++ b/lib/ansible/playbook/__init__.py
@@ -573,11 +573,12 @@ class PlayBook(object):
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.
- if (
- (task.any_errors_fatal and len(host_list) < hosts_count) or
- ((hosts_count - len(host_list)) > int((play.max_fail_pct)/100.0 * hosts_count))
- ):
+ # Set max_fail_pct to 0, So if any hosts fails, bail out
+ if task.any_errors_fatal and len(host_list) < hosts_count:
+ 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 no hosts remain, drop out