diff options
author | James Cammarata <jimi@sngx.net> | 2016-01-14 11:54:22 -0500 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2016-01-14 16:51:31 -0500 |
commit | 92136d8d84d3edb2470cd2aae4bda55d64cbe62d (patch) | |
tree | d1fe93ec91d7626b15669419fb22b98b407023d4 | |
parent | 42e66c3511c1facc7ea143fe726d81b0663c3094 (diff) | |
download | ansible-92136d8d84d3edb2470cd2aae4bda55d64cbe62d.tar.gz |
Hack to work around callback API change for v2_playbook_on_start
-rw-r--r-- | lib/ansible/executor/task_queue_manager.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/ansible/executor/task_queue_manager.py b/lib/ansible/executor/task_queue_manager.py index dae70a1292..e3c5e4a5fd 100644 --- a/lib/ansible/executor/task_queue_manager.py +++ b/lib/ansible/executor/task_queue_manager.py @@ -288,7 +288,20 @@ class TaskQueueManager: for method in methods: if method is not None: try: - method(*args, **kwargs) + # 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) except Exception as e: try: v1_method = method.replace('v2_','') |