diff --git a/changelogs/fragments/82947.yml b/changelogs/fragments/82947.yml new file mode 100644 index 00000000000..8ff16288a84 --- /dev/null +++ b/changelogs/fragments/82947.yml @@ -0,0 +1,3 @@ +--- +removed_features: + - loader - remove deprecated non-inclusive words (https://github.com/ansible/ansible/issues/82947). diff --git a/lib/ansible/plugins/loader.py b/lib/ansible/plugins/loader.py index 10607fd14d1..266b67d11b9 100644 --- a/lib/ansible/plugins/loader.py +++ b/lib/ansible/plugins/loader.py @@ -1098,10 +1098,6 @@ class PluginLoader: needs_enabled = False if hasattr(obj, 'REQUIRES_ENABLED'): needs_enabled = obj.REQUIRES_ENABLED - elif hasattr(obj, 'REQUIRES_WHITELIST'): - needs_enabled = obj.REQUIRES_WHITELIST - display.deprecated("The VarsModule class variable 'REQUIRES_WHITELIST' is deprecated. " - "Use 'REQUIRES_ENABLED' instead.", version=2.18) if not needs_enabled: # Use get_with_context to cache the plugin the first time we see it. self.get_with_context(fqcn)[0] @@ -1412,13 +1408,6 @@ def _load_plugin_filter(): # Modules and action plugins share the same reject list since the difference between the # two isn't visible to the users if version == u'1.0': - - if 'module_blacklist' in filter_data: - display.deprecated("'module_blacklist' is being removed in favor of 'module_rejectlist'", version='2.18') - if 'module_rejectlist' not in filter_data: - filter_data['module_rejectlist'] = filter_data['module_blacklist'] - del filter_data['module_blacklist'] - try: filters['ansible.modules'] = frozenset(filter_data['module_rejectlist']) except TypeError: diff --git a/lib/ansible/vars/plugins.py b/lib/ansible/vars/plugins.py index c2343507f28..a5fcd7bc602 100644 --- a/lib/ansible/vars/plugins.py +++ b/lib/ansible/vars/plugins.py @@ -90,7 +90,7 @@ def get_vars_from_path(loader, path, entities, stage): collection = '.' in plugin.ansible_name and not plugin.ansible_name.startswith('ansible.builtin.') # Warn if a collection plugin has REQUIRES_ENABLED because it has no effect. - if collection and (hasattr(plugin, 'REQUIRES_ENABLED') or hasattr(plugin, 'REQUIRES_WHITELIST')): + if collection and hasattr(plugin, 'REQUIRES_ENABLED'): display.warning( "Vars plugins in collections must be enabled to be loaded, REQUIRES_ENABLED is not supported. " "This should be removed from the plugin %s." % plugin.ansible_name diff --git a/test/integration/targets/old_style_vars_plugins/deprecation_warning/vars.py b/test/integration/targets/old_style_vars_plugins/deprecation_warning/vars.py deleted file mode 100644 index 22fb451e29d..00000000000 --- a/test/integration/targets/old_style_vars_plugins/deprecation_warning/vars.py +++ /dev/null @@ -1,10 +0,0 @@ -from __future__ import annotations - -from ansible.plugins.vars import BaseVarsPlugin - - -class VarsModule(BaseVarsPlugin): - REQUIRES_WHITELIST = True - - def get_vars(self, loader, path, entities): - return {} diff --git a/test/integration/targets/old_style_vars_plugins/runme.sh b/test/integration/targets/old_style_vars_plugins/runme.sh index 9f416235bb0..6905b78d29f 100755 --- a/test/integration/targets/old_style_vars_plugins/runme.sh +++ b/test/integration/targets/old_style_vars_plugins/runme.sh @@ -14,13 +14,10 @@ export ANSIBLE_VARS_ENABLED=require_enabled # Test deprecated features export ANSIBLE_VARS_PLUGINS=./deprecation_warning -WARNING_1="The VarsModule class variable 'REQUIRES_WHITELIST' is deprecated. Use 'REQUIRES_ENABLED' instead." -WARNING_2="The vars plugin v2_vars_plugin .* is relying on the deprecated entrypoints 'get_host_vars' and 'get_group_vars'" +WARNING="The vars plugin v2_vars_plugin .* is relying on the deprecated entrypoints 'get_host_vars' and 'get_group_vars'" ANSIBLE_DEPRECATION_WARNINGS=True ANSIBLE_NOCOLOR=True ANSIBLE_FORCE_COLOR=False \ ansible-inventory -i localhost, --list all "$@" 2> err.txt -for WARNING in "$WARNING_1" "$WARNING_2"; do - ansible localhost -m debug -a "msg={{ lookup('file', 'err.txt') | regex_replace('\n', '') }}" | grep "$WARNING" -done +ansible localhost -m debug -a "msg={{ lookup('file', 'err.txt') | regex_replace('\n', '') }}" | grep "$WARNING" # Test how many times vars plugins are loaded for a simple play containing a task # host_group_vars is stateless, so we can load it once and reuse it, every other vars plugin should be instantiated before it runs diff --git a/test/sanity/ignore.txt b/test/sanity/ignore.txt index 7a74a97b4e3..e43a0643da2 100644 --- a/test/sanity/ignore.txt +++ b/test/sanity/ignore.txt @@ -200,6 +200,5 @@ lib/ansible/playbook/base.py pylint:ansible-deprecated-version # 2.18 deprecati lib/ansible/playbook/play.py pylint:ansible-deprecated-version # 2.18 deprecation lib/ansible/playbook/play_context.py pylint:ansible-deprecated-version # 2.18 deprecation lib/ansible/plugins/action/__init__.py pylint:ansible-deprecated-version # 2.18 deprecation -lib/ansible/plugins/loader.py pylint:ansible-deprecated-version # 2.18 deprecation lib/ansible/template/__init__.py pylint:ansible-deprecated-version # 2.18 deprecation lib/ansible/vars/manager.py pylint:ansible-deprecated-version # 2.18 deprecation