summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fontein <felix@fontein.de>2022-11-15 16:03:47 +0100
committerGitHub <noreply@github.com>2022-11-15 10:03:47 -0500
commit1705ec98cd2eedbcf53cf20c52de007b4dfe5bab (patch)
tree71a29d28cff2620ca8724001a247d342ab0f95a1
parent66cc952b4910f0d98073740cac6e261ec3c19290 (diff)
downloadansible-1705ec98cd2eedbcf53cf20c52de007b4dfe5bab.tar.gz
ansible-doc and validate-modules: remove underscore deprecation handling for collections (#79362)
* Remove underscore deprecation handling for collections. * Also consider ansible.legacy.
-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':