Implement max_fail_percentage and any_errors_fatal support

Fixes #11997
This commit is contained in:
James Cammarata 2015-08-26 12:03:13 -04:00
parent af41ba929c
commit 50448d68e1
3 changed files with 36 additions and 3 deletions

View file

@ -39,6 +39,13 @@ from ansible.playbook.taggable import Taggable
__all__ = ['Task']
try:
from __main__ import display
display = display
except ImportError:
from ansible.utils.display import Display
display = Display()
class Task(Base, Conditional, Taggable, Become):
"""
@ -193,6 +200,14 @@ class Task(Base, Conditional, Taggable, Become):
return super(Task, self).preprocess_data(new_ds)
def _load_any_errors_fatal(self, attr, value):
'''
Exists only to show a deprecation warning, as this attribute is not valid
at the task level.
'''
display.deprecated("Setting any_errors_fatal on a task is no longer supported. This should be set at the play level only")
return None
def post_validate(self, templar):
'''
Override of base class post_validate, to also do final validation on