Skip to content

Commit e631b5b

Browse files
authored
Do not mangle plugin names in collections that start with an underscore. (#82574) (#82885)
(cherry picked from commit c082134)
1 parent e702033 commit e631b5b

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bugfixes:
2+
- "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)."
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/python
2+
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
3+
4+
from __future__ import annotations
5+
6+
DOCUMENTATION = '''
7+
module: _module3
8+
short_description: Another test module
9+
description: This is a test module that has not been deprecated.
10+
author:
11+
- Ansible Core Team
12+
'''
13+
14+
EXAMPLES = '''
15+
- minimal:
16+
'''
17+
18+
RETURN = ''''''
19+
20+
from ansible.module_utils.basic import AnsibleModule
21+
22+
23+
def main():
24+
module = AnsibleModule(
25+
argument_spec={},
26+
)
27+
28+
module.exit_json()
29+
30+
31+
if __name__ == '__main__':
32+
main()

test/lib/ansible_test/_internal/commands/sanity/ansible_doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def test(self, args: SanityConfig, targets: SanityTargets, python: PythonConfig)
7979
plugin_parts = os.path.relpath(plugin_file_path, plugin_path).split(os.path.sep)
8080
plugin_name = os.path.splitext(plugin_parts[-1])[0]
8181

82-
if plugin_name.startswith('_'):
82+
if plugin_name.startswith('_') and not data_context().content.collection:
8383
plugin_name = plugin_name[1:]
8484

8585
plugin_fqcn = data_context().content.prefix + '.'.join(plugin_parts[:-1] + [plugin_name])

0 commit comments

Comments
 (0)