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
Update default.py #83165
Closed
Closed
Update default.py #83165
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### SUMMARY Added type hints and a docstring to the `v2_runner_on_failed` method in `lib/ansible/plugins/callback/default.py`. This change is meant to help others understand the purpose of the method and the parameters that the method will accept. The docstring also provides additional information for programmers who may want to use the method in a custom callback plugin. ##### ISSUE TYPE - Docs Pull Request ##### ADDITIONAL INFORMATION This change does not alter the method's output. All tests in test.units.plugins.callback.test_callback passed: ```text test_display (test.units.plugins.callback.test_callback.TestCallback) ... ok test_display_verbose (test.units.plugins.callback.test_callback.TestCallback) ... ok test_host_label (test.units.plugins.callback.test_callback.TestCallback) ... ok test_host_label_delegated (test.units.plugins.callback.test_callback.TestCallback) ... ok test_init (test.units.plugins.callback.test_callback.TestCallback) ... ok test_clear_file (test.units.plugins.callback.test_callback.TestCallbackDiff) ... ok test_diff_after_none (test.units.plugins.callback.test_callback.TestCallbackDiff) ... ok test_diff_before_none (test.units.plugins.callback.test_callback.TestCallbackDiff) ... ok test_diff_dicts (test.units.plugins.callback.test_callback.TestCallbackDiff) ... ok test_difflist (test.units.plugins.callback.test_callback.TestCallbackDiff) ... ok test_new_file (test.units.plugins.callback.test_callback.TestCallbackDiff) ... ok test_no_trailing_newline_after (test.units.plugins.callback.test_callback.TestCallbackDiff) ... ok test_no_trailing_newline_before (test.units.plugins.callback.test_callback.TestCallbackDiff) ... ok test_no_trailing_newline_both (test.units.plugins.callback.test_callback.TestCallbackDiff) ... ok test_no_trailing_newline_both_with_some_changes (test.units.plugins.callback.test_callback.TestCallbackDiff) ... ok test_simple_diff (test.units.plugins.callback.test_callback.TestCallbackDiff) ... ok test_are_methods (test.units.plugins.callback.test_callback.TestCallbackOnMethods) ... ok test_on_any (test.units.plugins.callback.test_callback.TestCallbackOnMethods) ... ok test_clean_results (test.units.plugins.callback.test_callback.TestCallbackResults) ... ok test_clean_results_debug_task (test.units.plugins.callback.test_callback.TestCallbackResults) ... ok test_clean_results_debug_task_empty_results (test.units.plugins.callback.test_callback.TestCallbackResults) ... ok test_clean_results_debug_task_no_invocation (test.units.plugins.callback.test_callback.TestCallbackResults) ... ok test_get_item_label (test.units.plugins.callback.test_callback.TestCallbackResults) ... ok test_get_item_label_no_log (test.units.plugins.callback.test_callback.TestCallbackResults) ... ok ---------------------------------------------------------------------- Ran 24 tests in 0.012s OK ```
ansibot
added
the
needs_triage
Needs a first human triage before being processed.
label
Apr 30, 2024
I will continue to add docstrings to the remaining methods in |
mkrizek
removed
the
needs_triage
Needs a first human triage before being processed.
label
Apr 30, 2024
bcoca
reviewed
May 1, 2024
@@ -47,7 +48,20 @@ def __init__(self): | |||
super(CallbackModule, self).__init__() | |||
|
|||
def v2_runner_on_failed(self, result, ignore_errors=False): |
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.
instead doing this on the default callback, i would update the base class
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.
Sounds good.
Removed changes from default.py.
Updated v2_runner_on_failed docstring in base class instead of default.py (recommended by @bcoca).
ansibot
added
the
needs_revision
This PR fails CI tests or a maintainer has requested a review/revision of the PR.
label
May 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
needs_revision
This PR fails CI tests or a maintainer has requested a review/revision of the PR.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
Added type hints and a docstring to the
v2_runner_on_failed
method inlib/ansible/plugins/callback/default.py
. This change is meant to help others understand the purpose of the method and the parameters that the method will accept. The docstring also provides additional information for programmers who may want to use the method in a custom callback plugin.ISSUE TYPE
ADDITIONAL INFORMATION
This change does not alter the method's output. All tests in test.units.plugins.callback.test_callback passed: