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

Hack to work around callback API change for v2_playbook_on_start

This commit is contained in:
James Cammarata 2016-01-14 11:54:22 -05:00
parent c14eece0c6
commit 0b86aa62e1

View file

@ -288,6 +288,19 @@ class TaskQueueManager:
for method in methods: for method in methods:
if method is not None: if method is not None:
try: try:
# temporary hack, required due to a change in the callback API, so
# we don't break backwards compatibility with callbacks which were
# designed to use the original API
# FIXME: target for removal and revert to the original code here
# after a year (2017-01-14)
if method_name == 'v2_playbook_on_start':
import inspect
(f_args, f_varargs, f_keywords, f_defaults) = inspect.getargspec(method)
if 'playbook' in args:
method(*args, **kwargs)
else:
method()
else:
method(*args, **kwargs) method(*args, **kwargs)
except Exception as e: except Exception as e:
import traceback import traceback