From d82a902043039592dd5d00ba114b40cfc79e5e8f Mon Sep 17 00:00:00 2001 From: Sebastian Tobie Date: Mon, 17 Mar 2025 21:11:22 +0100 Subject: [PATCH] fixed an issue with choices in lists --- plugins/module_utils/generic.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/module_utils/generic.py b/plugins/module_utils/generic.py index 6700356..65a891b 100644 --- a/plugins/module_utils/generic.py +++ b/plugins/module_utils/generic.py @@ -124,9 +124,8 @@ class Types(metaclass=meta): f"helptext of option {name} is unset." " Ansible requires suboptions to have an documentation" ) - elif elements["type"] == "list": - if "choices" in elements: - option["choices"] = elements["choices"] + elif "choices" in elements: + option["choices"] = elements["choices"] if default is not None: option["default"] = default if help is not None and isinstance(help, str):