diff options
author | James Cammarata <jimi@sngx.net> | 2015-10-12 09:00:43 -0400 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2015-10-12 09:00:43 -0400 |
commit | 82e76e42e5366e470b05f27faa30339052ee2550 (patch) | |
tree | 60d593698c3e874b4be6ace49fb8be0efd1f2e88 | |
parent | 63e288354e5674ef0adbb1c65c393892fb13a0ff (diff) | |
download | ansible-82e76e42e5366e470b05f27faa30339052ee2550.tar.gz |
Tweak to the way serial percentages are handled
-rw-r--r-- | lib/ansible/executor/playbook_executor.py | 5 | ||||
-rw-r--r-- | lib/ansible/playbook/play.py | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/ansible/executor/playbook_executor.py b/lib/ansible/executor/playbook_executor.py index 9f295cbe1e..0b3d7f0db7 100644 --- a/lib/ansible/executor/playbook_executor.py +++ b/lib/ansible/executor/playbook_executor.py @@ -227,7 +227,10 @@ class PlaybookExecutor: serial_pct = int(play.serial.replace("%","")) serial = int((serial_pct/100.0) * len(all_hosts)) else: - serial = int(play.serial) + if play.serial is None: + serial = -1 + else: + serial = int(play.serial) # if the serial count was not specified or is invalid, default to # a list of all hosts, otherwise split the list of hosts into chunks diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index a24eb133cc..f6ae213a5c 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -87,7 +87,7 @@ class Play(Base, Taggable, Become): _any_errors_fatal = FieldAttribute(isa='bool', default=False, always_post_validate=True) _force_handlers = FieldAttribute(isa='bool', always_post_validate=True) _max_fail_percentage = FieldAttribute(isa='percent', always_post_validate=True) - _serial = FieldAttribute(isa='percent', default=0, always_post_validate=True) + _serial = FieldAttribute(isa='string', always_post_validate=True) _strategy = FieldAttribute(isa='string', default='linear', always_post_validate=True) # ================================================================================= |