Skip to content
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

Merged
merged 3 commits into from Sep 16, 2021

Conversation

rjeffman
Copy link
Member

Modify ipasudocmd and ipasudocmdgroup to use execute_ipa_commands.

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.
@@ -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
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Will do.

@rjeffman rjeffman force-pushed the sudocmd_use_execute_ipa_commands branch 2 times, most recently from fd6c7e2 to 31ff315 Compare September 14, 2021 17:08
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.
@rjeffman rjeffman force-pushed the sudocmd_use_execute_ipa_commands branch from 31ff315 to 1615f59 Compare September 14, 2021 17:10
Copy link
Member

@t-woerner t-woerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@t-woerner t-woerner merged commit ccb07cb into freeipa:master Sep 16, 2021
@rjeffman rjeffman deleted the sudocmd_use_execute_ipa_commands branch February 23, 2022 18:17
@rjeffman rjeffman restored the sudocmd_use_execute_ipa_commands branch February 23, 2022 18:20
@rjeffman rjeffman deleted the sudocmd_use_execute_ipa_commands branch February 23, 2022 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants