mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
[PR #10027/299172d2 backport][stable-10] fixed hidden warnings from extra tests - batch 2 (#10101)
fixed hidden warnings from extra tests - batch 2 (#10027)
* fixed hidden warnings from extra tests - batch 2
* remove multiple yaml doc markers from EXAMPLE blocks
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* Apply suggestions from code review
* Apply suggestions from code review
* dig: adjust markup for return suboptions
* Update plugins/lookup/dig.py
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 299172d27b)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
@@ -5,18 +5,17 @@
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = """
|
||||
DOCUMENTATION = r"""
|
||||
name: collection_version
|
||||
author: Felix Fontein (@felixfontein)
|
||||
version_added: "4.0.0"
|
||||
short_description: Retrieves the version of an installed collection
|
||||
description:
|
||||
- This lookup allows to query the version of an installed collection, and to determine whether a
|
||||
collection is installed at all.
|
||||
- By default it returns V(none) for non-existing collections and V(*) for collections without a
|
||||
version number. The latter should only happen in development environments, or when installing
|
||||
a collection from git which has no version in its C(galaxy.yml). This behavior can be adjusted
|
||||
by providing other values with O(result_not_found) and O(result_no_version).
|
||||
- This lookup allows to query the version of an installed collection, and to determine whether a collection is installed
|
||||
at all.
|
||||
- By default it returns V(none) for non-existing collections and V(*) for collections without a version number. The latter
|
||||
should only happen in development environments, or when installing a collection from git which has no version in its C(galaxy.yml).
|
||||
This behavior can be adjusted by providing other values with O(result_not_found) and O(result_no_version).
|
||||
options:
|
||||
_terms:
|
||||
description:
|
||||
@@ -34,30 +33,27 @@ options:
|
||||
result_no_version:
|
||||
description:
|
||||
- The value to return when the collection has no version number.
|
||||
- This can happen for collections installed from git which do not have a version number
|
||||
in C(galaxy.yml).
|
||||
- This can happen for collections installed from git which do not have a version number in C(galaxy.yml).
|
||||
- By default, V(*) is returned.
|
||||
type: string
|
||||
default: '*'
|
||||
"""
|
||||
|
||||
EXAMPLES = """
|
||||
EXAMPLES = r"""
|
||||
- name: Check version of community.general
|
||||
ansible.builtin.debug:
|
||||
msg: "community.general version {{ lookup('community.general.collection_version', 'community.general') }}"
|
||||
"""
|
||||
|
||||
RETURN = """
|
||||
_raw:
|
||||
description:
|
||||
- The version number of the collections listed as input.
|
||||
- If a collection can not be found, it will return the value provided in O(result_not_found).
|
||||
By default, this is V(none).
|
||||
- If a collection can be found, but the version not identified, it will return the value provided in
|
||||
O(result_no_version). By default, this is V(*). This can happen for collections installed
|
||||
from git which do not have a version number in V(galaxy.yml).
|
||||
type: list
|
||||
elements: str
|
||||
RETURN = r"""
|
||||
_raw:
|
||||
description:
|
||||
- The version number of the collections listed as input.
|
||||
- If a collection can not be found, it will return the value provided in O(result_not_found). By default, this is V(none).
|
||||
- If a collection can be found, but the version not identified, it will return the value provided in O(result_no_version).
|
||||
By default, this is V(*). This can happen for collections installed from git which do not have a version number in V(galaxy.yml).
|
||||
type: list
|
||||
elements: str
|
||||
"""
|
||||
|
||||
import json
|
||||
|
||||
Reference in New Issue
Block a user