diff --git a/changelogs/fragments/82575-ansible-test-validate-modules-underscore.yml b/changelogs/fragments/82575-ansible-test-validate-modules-underscore.yml new file mode 100644 index 00000000000..ffcb3010d2c --- /dev/null +++ b/changelogs/fragments/82575-ansible-test-validate-modules-underscore.yml @@ -0,0 +1,2 @@ +bugfixes: + - "ansible-test validate-modules sanity test - do not treat leading underscores for plugin names in collections as an attempted deprecation (https://github.com/ansible/ansible/pull/82575)." diff --git a/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/modules/_not_deprecated.py b/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/modules/_not_deprecated.py new file mode 100644 index 00000000000..4b4b09134e2 --- /dev/null +++ b/test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/modules/_not_deprecated.py @@ -0,0 +1,22 @@ +#!/usr/bin/python +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import annotations + +DOCUMENTATION = ''' +module: _not_deprecated +short_description: This module is not deprecated +description: Its name has a leading underscore, but it is not deprecated. +author: + - Ansible Core Team +''' + +EXAMPLES = '''#''' +RETURN = '''''' + +from ansible.module_utils.basic import AnsibleModule + + +if __name__ == '__main__': + module = AnsibleModule(argument_spec=dict()) + module.exit_json() diff --git a/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py b/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py index e1d8ec2cd11..5e3a07e33b6 100644 --- a/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py +++ b/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py @@ -1099,14 +1099,6 @@ class ModuleValidator(Validator): ' documentation for removed' ) else: - # We are testing a collection - if self.object_name.startswith('_'): - self.reporter.error( - path=self.object_path, - code='collections-no-underscore-on-deprecation', - msg='Deprecated content in collections MUST NOT start with "_", update meta/runtime.yml instead', - ) - if not (doc_deprecated == routing_says_deprecated): # DOCUMENTATION.deprecated and meta/runtime.yml disagree self.reporter.error(