mirror of https://github.com/ansible/ansible.git
validate-modules: Check for correct values in choice (#82266)
* validate-modules: Check for correct values in choice * validate-modules test now checks the length of choices and correct option values inside the choice. Fixes: #82179 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> * Fix sanity tests Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> --------- Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>pull/82316/head
parent
0806da55b1
commit
e6e19e37f7
@ -0,0 +1,33 @@
|
|||||||
|
#!/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: invalid_choice_value
|
||||||
|
short_description: Test for equal length of chocies with correct options
|
||||||
|
description: Test for equal length of chocies with correct options
|
||||||
|
author:
|
||||||
|
- Ansible Core Team
|
||||||
|
options:
|
||||||
|
caching:
|
||||||
|
description:
|
||||||
|
- Type of Caching.
|
||||||
|
type: str
|
||||||
|
choices:
|
||||||
|
- ReadOnly
|
||||||
|
- ReadWrite
|
||||||
|
"""
|
||||||
|
|
||||||
|
EXAMPLES = """#"""
|
||||||
|
RETURN = """"""
|
||||||
|
|
||||||
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
module = AnsibleModule(
|
||||||
|
argument_spec=dict(caching=dict(type="str", choices=["ReadOnly", "ReadOnly"])),
|
||||||
|
supports_check_mode=False,
|
||||||
|
)
|
||||||
|
module.exit_json()
|
Loading…
Reference in New Issue