ansible/ansible — pull request #3159 by cchurch (2013-06-09 16:37:10+00:00)
Title: Callback Plugin Context / Naming Fixes

As is, the current play is set for the callback plugins when loading the play, instead of when running it, which will provide the incorrect play to the callback if there are multiple plays in a playbook. **This pull request sets the current play immediately before running it.**

Neither of the context variables (play/task) are cleared after running the current play/task. As a result, certain events (e.g., `playbook_on_stats`) will still have a play and task set, even though there is no longer a current play or task. **This pull request sets the current play/task to None immediately after running it.**

The naming of the `on_no_hosts_matched` and `on_no_hosts_remaining` methods in the noop plugin is incorrect, and these methods will never be called. **This pull request prefixes the method names with `playbook_` so they will be called, and adds these new methods to the sample callback plugins.**