module_params_get*: Fail on empty string in string list parameters
So far it is possible to pass list parameters with empty strings to the modules. The use of empty strings in list does not make a lot of sense, though. The simple solution is to add a check to module_params_get for empty strings in returned lists. The option allow_empty_string can be set to True to allow an empty string in the list with a list len of 1. The option defaults to False. It is needed for some parameters the modules, like for example userauthtype in the user module. It is using "" to reset to the default value. module_params_get_lowercase has been changed to use module_params_get to have one place to add the check. Due to an issue in Ansible it is possible to use the empty string "" for lists with choices, even if the empty list is not part of the choices. Ansible issue https://github.com/ansible/ansible/issues/77108
Loading
Please register or sign in to comment