-
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
Use batch command internally #1229
Conversation
04acbd4
to
7b4a310
Compare
d604d80
to
d7ca265
Compare
@@ -1399,34 +1410,94 @@ def exception_handler(module, ex, exit_args, one_name): | |||
if "errors" in argspec.args: | |||
handlers_user_args["errors"] = _errors | |||
|
|||
debug = 0x10 | |||
if debug & 0x1: |
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.
What about calling these flags IPA_DBG_CMD_LIST
and IPA_DBG_CMD_COUNT
and make them class members?
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.
I added DEBUG_COMMAND_* constants for this.
The method execute_ipa_commands has been extended to handle multi commands with the batch command. New constants for execute_ipa_commands debugging: DEBUG_COMMAND_ALL = 0b1111 DEBUG_COMMAND_LIST = 0b0001 Print the while command list DEBUG_COMMAND_COUNT = 0b0010 Print the command number DEBUG_COMMAND_BATCH = 0b0100 Print information about the batch slice size and currently executed batch slice New parameters have been added to execute_ipa_commands: batch: bool Enable batch command use to speed up processing batch_slice_size: integer Maximum mumber of commands processed in a slice with the batch command keeponly: list of string The attributes to keep in the results returned. Default: None (Keep all) debug: integer Enable debug output for the exection using DEBUG_COMMAND_* Batch mode can be enabled within the module with setting batch to True for execute_ipa_commands. Fixes: freeipa#1128 (batch command support)
The use of the batch command is enabled for execute_ipa_commands. Additionally keeponly is set to ["randompassword"] as this is the only parameter that is used from the data returned from the commands.
The use of the batch command is enabled for execute_ipa_commands. Additionally keeponly is set to [] as nothing is used from the data returned from the commands.
The use of the batch command is enabled for execute_ipa_commands. Additionally keeponly is set to [] as nothing is used from the data returned from the commands.
The use of the batch command is enabled for execute_ipa_commands. Additionally keeponly is set to ["randompassword"] as this is the only parameter that is used from the data returned from the commands.
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
Changes look good to me. The pylint failure is being addressed in another PR. I'll merge this PR as soon as checks pass. |
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.
IPAAnsibleModule: Add support for batch command in execute_ipa_commands
ipauser: Enable batch command use with keeponly
ipaservice: Enable batch command use with keeponly
ipagroup: Enable batch command use with keeponly
ipahost: Enable batch command with keeponly