1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Correct placement of right parenthesis.

(serial_pct)/100.0 is a typo - the parentheses should be around the entire percentage calculation, which makes much more sense when multiplying by the number of hosts (luckily BODMAS prevailed).
This commit is contained in:
hoettle 2014-02-25 23:11:05 +11:00 committed by Michael DeHaan
parent cbf0bd6baf
commit 4243ce61b3

View file

@ -642,7 +642,7 @@ class PlayBook(object):
# This is a percentage, so calculate it based on the
# number of hosts
serial_pct = int(play.serial.replace("%",""))
serial = int((serial_pct)/100.0 * len(all_hosts))
serial = int((serial_pct/100.0) * len(all_hosts))
# Ensure that no matter how small the percentage, serial
# can never fall below 1, so that things actually happen