From 53cbc9f6ee7ce5c971e71e3d69321cfb0e368764 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 17 Nov 2017 12:27:32 -0500 Subject: [PATCH] fix localized set options in callbacks signature changed but callbacks overriding it were not updated fixes #33006 --- lib/ansible/plugins/callback/logentries.py | 5 ++--- lib/ansible/plugins/callback/profile_tasks.py | 4 ++-- lib/ansible/plugins/callback/selective.py | 4 ++-- lib/ansible/plugins/callback/slack.py | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/ansible/plugins/callback/logentries.py b/lib/ansible/plugins/callback/logentries.py index b9f6749657..a572c8e38c 100644 --- a/lib/ansible/plugins/callback/logentries.py +++ b/lib/ansible/plugins/callback/logentries.py @@ -111,7 +111,6 @@ try: except ImportError: HAS_FLATDICT = False -from ansible.errors import AnsibleError from ansible.module_utils._text import to_bytes, to_text, to_native from ansible.plugins.callback import CallbackBase @@ -249,9 +248,9 @@ class CallbackModule(CallbackBase): # self.set_options({'api': 'data.logentries.com', 'port': 80, # 'tls_port': 10000, 'use_tls': True, 'flatten': False, 'token': 'ae693734-4c5b-4a44-8814-1d2feb5c8241'}) - def set_options(self, options): + def set_options(self, task_keys=None, var_options=None, direct=None): - super(CallbackModule, self).set_options(options) + super(CallbackModule, self).set_options(task_keys=task_keys, var_options=var_options, direct=direct) # get options try: diff --git a/lib/ansible/plugins/callback/profile_tasks.py b/lib/ansible/plugins/callback/profile_tasks.py index 026cf3e360..5869bfb2f6 100644 --- a/lib/ansible/plugins/callback/profile_tasks.py +++ b/lib/ansible/plugins/callback/profile_tasks.py @@ -119,9 +119,9 @@ class CallbackModule(CallbackBase): super(CallbackModule, self).__init__() - def set_options(self, options): + def set_options(self, task_keys=None, var_options=None, direct=None): - super(CallbackModule, self).set_options(options) + super(CallbackModule, self).set_options(task_keys=task_keys, var_options=var_options, direct=direct) self.sort_order = self._plugin_options['sort_order'] if self.sort_order is not None: diff --git a/lib/ansible/plugins/callback/selective.py b/lib/ansible/plugins/callback/selective.py index b4575cbc7b..d839add5c9 100644 --- a/lib/ansible/plugins/callback/selective.py +++ b/lib/ansible/plugins/callback/selective.py @@ -88,9 +88,9 @@ class CallbackModule(CallbackBase): self.last_task_name = None self.printed_last_task = False - def set_options(self, options): + def set_options(self, task_keys=None, var_options=None, direct=None): - super(CallbackModule, self).set_options(options) + super(CallbackModule, self).set_options(task_keys=task_keys, var_options=var_options, direct=direct) global DONT_COLORIZE DONT_COLORIZE = self._plugin_options['nocolor'] diff --git a/lib/ansible/plugins/callback/slack.py b/lib/ansible/plugins/callback/slack.py index 65e5b0b219..c7030fa43e 100644 --- a/lib/ansible/plugins/callback/slack.py +++ b/lib/ansible/plugins/callback/slack.py @@ -89,9 +89,9 @@ class CallbackModule(CallbackBase): # than 1 simultaneous playbooks running self.guid = uuid.uuid4().hex[:6] - def set_options(self, options): + def set_options(self, task_keys=None, var_options=None, direct=None): - super(CallbackModule, self).set_options(options) + super(CallbackModule, self).set_options(task_keys=task_keys, var_options=var_options, direct=direct) self.webhook_url = self._plugin_options['webhook_url'] self.channel = self._plugin_options['channel']