ansible
ansible copied to clipboard
Don't forget plugin deprecations after CLI init
SUMMARY
Fixes #73051.
ISSUE TYPE
- Bugfix Pull Request
COMPONENT NAME
lib/ansible/cli/__init__.py
lib/ansible/config/manager.py
/rebuild_failed
Just as an FYI, I tried this change locally and it looks like it requires the plugin to call set_options()
before the deprecation message will appear. Many of our builtin plugins (e.g., file
) do not call that method since it doesn't seem to be required to do so.
@Shrews memory is getting fuzzy now but when I hit this issue #73051 I remember looking through all of core, and any collections I happen to have cloned (c.g and the windows ones, besides community.hashi_vault), and the only existing examples of (this style of) deprecations I saw were in connection plugins, which aren't affected since their deprecations were processed early enough for them to be displayed.
Anyway, all that to say: it's probably fine that many plugins don't yet use config manager: if a deprecation is added to a plugin and wants to use the automatic display of it, it'll have to be converted, which probably isn't a bad thing.
Essentially you don't get config manager features if you don't use the config manager :-)
If you don't use the config manager, the DOCUMENTATION
content is only used by ansible-doc and the antsibull-docs. All other things in DOCUMENTATION
(like vars
, ini
, option type checking, ...) also don't work if you don't use the config manager, except if you implement them manually. Deprecations are no exception to that rule.
We need to fix some stuff in the new display remoting to workers to preserve dedupes on these, then we can merge this.
now that we have dedupe globally and already have the deprecation info, we can do something simpler like in #82593
@bcoca I would appreciate if you could ping me on any future issues/PRs that address this, my collection has workaround code that I would love to get rid of eventually.