quit plays with an error if there were failed tasks and handler execution is forced

This commit is contained in:
Leon Xie 2015-12-07 11:06:26 +08:00
parent ab18fd2171
commit 0da8c8bdd5

View file

@ -826,6 +826,11 @@ class PlayBook(object):
# if there were failed tasks and handler execution
# is not forced, quit the play with an error
return False
elif task_errors:
# if there were failed tasks and handler execution is forced,
# execute all handlers and quit the play with an error
self.run_handlers(play)
return False
else:
# no errors, go ahead and execute all handlers
if not self.run_handlers(play):