-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module_params_get*: Fail on empty string in string list parameters #779
module_params_get*: Fail on empty string in string list parameters #779
Conversation
efebe5a
to
e5dfb4e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Triggered Downstream tests with this PR pipelines#1722057
@t-woerner
|
This PR would not fix this issue:
See PR #754 which is a draft that aims to fix this specific issue. |
fc1d5c5
to
0f2965b
Compare
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 ansible/ansible#77108
The parameters userauthtype and sshpubkey allowing to use "" to reset to the default value. The new check in params_get is not allowing to use empty strings in lists, therefore allow_empty_string=True had to be added to the call. A test has been added to verify that the empty strings are supported and working. An idempotency issue with sshpubkey has been found with the test and fixed additionally.
0f2965b
to
7219161
Compare
df552e5
to
1317701
Compare
The parameters auth_ind and pac_type are allowing to use "" to reset to the default value. The new check in params_get is not allowing to use empty strings in lists, therefore allow_empty_string=True had to be added to the call. A test has been added to verify that the empty strings are supported and working. An idempotency issue with pac_type has been found with the test and fixed additionally.
The parameter auth_ind is allowing to use "" to reset to the default value. The new check in params_get is not allowing to use empty strings in lists, therefore allow_empty_string=True had to be added to the call. A test has been added to verify that the empty strings are supported and working.
1317701
to
3a342b8
Compare
…gstring The parameters user_auth_type, pac_type and configstring are allowing to use "" to reset to the default value or for configstring to set an empty list. The new check in params_get is not allowing to use empty strings in lists, therefore allow_empty_string=True had to be added to the call. A test has been added to verify that the empty strings are supported and working. Additionally empty pac_type, user_auth_type and domain_resolution_order have been added to exit_args as if they have not been set.
3a342b8
to
e30bcfd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
LGTM |
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.
module_params_get_lowercase has been changed to use module_params_get to
have one place to add the check.