summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelogs/fragments/79362-validate-modules-underscore.yml6
-rwxr-xr-xlib/ansible/cli/doc.py4
-rw-r--r--test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py2
3 files changed, 10 insertions, 2 deletions
diff --git a/changelogs/fragments/79362-validate-modules-underscore.yml b/changelogs/fragments/79362-validate-modules-underscore.yml
new file mode 100644
index 0000000000..c3bc21c506
--- /dev/null
+++ b/changelogs/fragments/79362-validate-modules-underscore.yml
@@ -0,0 +1,6 @@
+breaking_changes:
+ - "ansible-doc - no longer treat plugins in collections whose name starts with ``_`` as deprecated
+ (https://github.com/ansible/ansible/pull/79217)."
+ - "ansible-test sanity - previously plugins and modules in collections whose name started with ``_``
+ were treated as deprecated, even when they were not marked as deprecated in ``meta/runtime.yml``.
+ This is no longer the case (https://github.com/ansible/ansible/pull/79362)."
diff --git a/lib/ansible/cli/doc.py b/lib/ansible/cli/doc.py
index 803653038a..a43cb3307f 100755
--- a/lib/ansible/cli/doc.py
+++ b/lib/ansible/cli/doc.py
@@ -495,7 +495,9 @@ class DocCLI(CLI, RoleMixin):
desc = desc[:linelimit] + '...'
pbreak = plugin.split('.')
- if pbreak[-1].startswith('_'): # Handle deprecated # TODO: add mark for deprecated collection plugins
+ # TODO: add mark for deprecated collection plugins
+ if pbreak[-1].startswith('_') and plugin.startswith(('ansible.builtin.', 'ansible.legacy.')):
+ # Handle deprecated ansible.builtin plugins
pbreak[-1] = pbreak[-1][1:]
plugin = '.'.join(pbreak)
deprecated.append("%-*s %-*.*s" % (displace, plugin, linelimit, len(desc), desc))
diff --git a/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py b/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py
index de387eef8c..3de3a4fda5 100644
--- a/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py
+++ b/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py
@@ -794,7 +794,7 @@ def author(value):
def doc_schema(module_name, for_collection=False, deprecated_module=False, plugin_type='module'):
- if module_name.startswith('_'):
+ if module_name.startswith('_') and not for_collection:
module_name = module_name[1:]
deprecated_module = True
if for_collection is False and plugin_type == 'connection' and module_name == 'paramiko_ssh':