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

Fix context_demo callback plugin. (#17235)

This commit is contained in:
Chris Faulkner 2016-08-25 10:22:27 -07:00 committed by Matt Davis
parent 8fd3935029
commit dbab23e68f

View file

@ -32,21 +32,16 @@ class CallbackModule(CallbackBase):
CALLBACK_NEEDS_WHITELIST = True
def __init__(self, *args, **kwargs):
super(CallbackModule, self).__init__(*args, **kwargs)
self.task = None
self.play = None
def v2_on_any(self, *args, **kwargs):
i = 0
if self.play:
play_str = 'play: %s' % self.play.name
if self.task:
task_str = 'task: %s' % self.task
self._display.display("--- %s %s ---" % (self.play_str, self.task_str))
self._display.display("--- play: {} task: {} ---".format(getattr(self.play, 'name', None), self.task))
self._display.display(" --- ARGS ")
for a in args:
for i, a in enumerate(args):
self._display.display(' %s: %s' % (i, a))
i += 1
self._display.display(" --- KWARGS ")
for k in kwargs: