Do not mangle plugin names in collections that start with an underscore. (#82574) (#82886)

(cherry picked from commit c0821346fc)
pull/83027/head
Felix Fontein 8 months ago committed by GitHub
parent 12239abf72
commit 8ba086ce87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
bugfixes:
- "ansible-test ansible-doc sanity test - do not remove underscores from plugin names in collections before calling ``ansible-doc`` (https://github.com/ansible/ansible/pull/82574)."

@ -0,0 +1,32 @@
#!/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: _module3
short_description: Another test module
description: This is a test module that has not been deprecated.
author:
- Ansible Core Team
'''
EXAMPLES = '''
- minimal:
'''
RETURN = ''''''
from ansible.module_utils.basic import AnsibleModule
def main():
module = AnsibleModule(
argument_spec={},
)
module.exit_json()
if __name__ == '__main__':
main()

@ -79,7 +79,7 @@ class AnsibleDocTest(SanitySingleVersion):
plugin_parts = os.path.relpath(plugin_file_path, plugin_path).split(os.path.sep)
plugin_name = os.path.splitext(plugin_parts[-1])[0]
if plugin_name.startswith('_'):
if plugin_name.startswith('_') and not data_context().content.collection:
plugin_name = plugin_name[1:]
plugin_fqcn = data_context().content.prefix + '.'.join(plugin_parts[:-1] + [plugin_name])

Loading…
Cancel
Save