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

Standardize algorithm to verify if invalid argument was used. #652

Merged
merged 26 commits into from Oct 4, 2021

Conversation

rjeffman
Copy link
Member

@rjeffman rjeffman commented Oct 1, 2021

Almost all modules use a similar algorithm to validate if parameters
should not have had a value provided by user, and as the algorithm is
implemented in each method, errors may occur, and error messages
may differ.

This PR proposes the use of a common procedure for all modules, based on
an IPAAnsibleModule method. The module provides a list of attributes that
shuld be null for the state/action requested, and the execution fails if one of
those attributes value is not None.

@rjeffman rjeffman force-pushed the ipaansiblemodule_fail_if_invalid branch from 308b317 to 31bc6fe Compare October 1, 2021 00:28
Almost all modules require an algorithm ta validade if the user
provided arguments for the playbook  are valid for the requested
state and/or action.

This patch provides a function that tests if any of a list of
arguments were set, and fail with a standardized message, making
all modules fail in the same way.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
Use the IPAAnsibleModule.params_fail_if_used method to validate
arguments provided by user.
@rjeffman rjeffman force-pushed the ipaansiblemodule_fail_if_invalid branch from 31bc6fe to 0fac277 Compare October 1, 2021 12:50
@rjeffman rjeffman changed the title WIP: Standardize algorithm no verify if invalid argument was used. Standardize algorithm no verify if invalid argument was used. Oct 1, 2021
@rjeffman rjeffman marked this pull request as ready for review October 1, 2021 13:12
@rjeffman rjeffman changed the title Standardize algorithm no verify if invalid argument was used. Standardize algorithm to verify if invalid argument was used. Oct 1, 2021
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 ee29425 into freeipa:master Oct 4, 2021
@rjeffman rjeffman deleted the ipaansiblemodule_fail_if_invalid branch February 23, 2022 18:18
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