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
Use execute_ipa_commands for sudocmd plugins. #634
Use execute_ipa_commands for sudocmd plugins. #634
Conversation
execute_ipa_commands replces the check mode exit, the loop over the generated commands and also in the member failure handling for modules with member support.
plugins/modules/ipasudocmdgroup.py
Outdated
@@ -100,7 +100,8 @@ | |||
""" | |||
|
|||
from ansible.module_utils.ansible_freeipa_module import \ | |||
IPAAnsibleModule, compare_args_ipa, gen_add_del_lists, ipalib_errors | |||
IPAAnsibleModule, compare_args_ipa, gen_add_del_lists, gen_add_list, \ | |||
gen_intersection_list, ipalib_errors |
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.
The use of gen_add_list and gen_intersection_list to reduce to the needed changes only should also be mentioned. Maybe this could be an extra commit.
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.
Without gen_add_list and gen_intersection_list, the patch would be bigger, as a custom result_handler
would be needed because of the already a member/not a member
issue.
Do you think it is better to have a commit with the custom handler and another committ/PR removing it?
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.
You could add the change with gen_add_list
and gen_intersection_list
prior to the other one in the PR for example.
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.
Ok. Will do.
fd6c7e2
to
31ff315
Compare
Use gen_add_list and gen_intersection_list for sudocmd member handling, to reduce the add lists to only the new and del lists only to existing entries. This enables to remove the ignores for "already a member" and "not a member" errors.
execute_ipa_commands replces the check mode exit, the loop over the generated commands and also in the member failure handling for modules with member support.
31ff315
to
1615f59
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
Modify ipasudocmd and ipasudocmdgroup to use
execute_ipa_commands
.