Skip to content

Commit

Permalink
fixed missing default (ansible#69972)
Browse files Browse the repository at this point in the history
* fixed missing default

 also deprecated so new options wont have to go through this
  • Loading branch information
bcoca authored Jun 10, 2020
1 parent f1ab7cf commit 805dff4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelogs/fragments/deprecate_default_call_fragmentless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
deprecated_features:
- Using the DefaultCallback without the correspodning doc_fragment or copying the documentation.
bugfixes:
- added new option for default callback to compat variable to avoid old 3rd party plugins from erroring out.
6 changes: 4 additions & 2 deletions lib/ansible/plugins/callback/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
from ansible.plugins.callback import CallbackBase
from ansible.utils.color import colorize, hostcolor


# These values use ansible.constants for historical reasons, mostly to allow
# unmodified derivative plugins to work. However, newer options added to the
# plugin are not also added to ansible.constants, so authors of derivative
Expand All @@ -57,7 +56,8 @@
('display_ok_hosts', True),
('show_custom_stats', C.SHOW_CUSTOM_STATS),
('display_failed_stderr', False),
('check_mode_markers', False),)
('check_mode_markers', False),
('show_per_host_start', False))


class CallbackModule(CallbackBase):
Expand Down Expand Up @@ -88,6 +88,8 @@ def set_options(self, task_keys=None, var_options=None, direct=None):
try:
value = self.get_option(option)
except (AttributeError, KeyError):
self._display.deprecated("'%s' is subclassing DefaultCallback without the corresponding doc_fragment." % self._load_name,
version='2.14')
value = constant
setattr(self, option, value)

Expand Down

0 comments on commit 805dff4

Please sign in to comment.