mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
c7bf3e035b
commit
05fcb8502f
2 changed files with 4 additions and 12 deletions
2
changelogs/fragments/cb_options_unoptional.yml
Normal file
2
changelogs/fragments/cb_options_unoptional.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- Now callback plugins MUST allow for setting options as deprecation period that allowed older callbacks to ignore this is over.
|
|
@ -132,12 +132,7 @@ class TaskQueueManager:
|
|||
raise AnsibleError("Invalid callback for stdout specified: %s" % self._stdout_callback)
|
||||
else:
|
||||
self._stdout_callback = callback_loader.get(self._stdout_callback)
|
||||
try:
|
||||
self._stdout_callback.set_options()
|
||||
except AttributeError:
|
||||
display.deprecated("%s stdout callback, does not support setting 'options', it will work for now, "
|
||||
" but this will be required in the future and should be updated,"
|
||||
" see the 2.4 porting guide for details." % self._stdout_callback._load_name, version="2.9")
|
||||
self._stdout_callback.set_options()
|
||||
stdout_callback_loaded = True
|
||||
else:
|
||||
raise AnsibleError("callback must be an instance of CallbackBase or the name of a callback plugin")
|
||||
|
@ -160,12 +155,7 @@ class TaskQueueManager:
|
|||
continue
|
||||
|
||||
callback_obj = callback_plugin()
|
||||
try:
|
||||
callback_obj.set_options()
|
||||
except AttributeError:
|
||||
display.deprecated("%s callback, does not support setting 'options', it will work for now, "
|
||||
" but this will be required in the future and should be updated, "
|
||||
" see the 2.4 porting guide for details." % callback_obj._load_name, version="2.9")
|
||||
callback_obj.set_options()
|
||||
self._callback_plugins.append(callback_obj)
|
||||
|
||||
for callback_plugin_name in (c for c in C.DEFAULT_CALLBACK_WHITELIST if is_collection_ref(c)):
|
||||
|
|
Loading…
Reference in a new issue