-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
network.py:ActionModule:run: does not honor _handle_src_option failures #52745
Conversation
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.
@chrisvanheuveln this PR contains the following merge commits: Please rebase your branch to remove these commits. |
@chrisvanheuveln this PR contains the following merge commits: Please rebase your branch to remove these commits. |
PR ansible#50301 moved template error handling out of run() and into its own method in `_handle_src_option`; however, after the change run() ignores the return value so any errors are ignored. Reproduceable with `nxos_config/tests/common/src_invalid.yaml` Verified fix with `nxos_config/tests/common/src_*` tests. Ref: ansible@71113ee#diff-7477bf046013758366cc85b06f90709aR43
This test was not actually testing with `src:` as it should have.
PR ansible#52912 fixed this already.
978525b
to
183a860
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.
@chrisvanheuveln Thank you!
…es (ansible#52745) * network.py:ActionModule:run: does not honor _handle_src_option failures PR ansible#50301 moved template error handling out of run() and into its own method in `_handle_src_option`; however, after the change run() ignores the return value so any errors are ignored. Reproduceable with `nxos_config/tests/common/src_invalid.yaml` Verified fix with `nxos_config/tests/common/src_*` tests. Ref: ansible@71113ee#diff-7477bf046013758366cc85b06f90709aR43 * nxos_config/tests/common/src_basic: Updated to test with src This test was not actually testing with `src:` as it should have. * Revert 412d7e change to plugins/action/network.py PR ansible#52912 fixed this already. * nxos_config: fix src_invalid test (cherry picked from commit d69239c)
…es (#52745) * network.py:ActionModule:run: does not honor _handle_src_option failures PR #50301 moved template error handling out of run() and into its own method in `_handle_src_option`; however, after the change run() ignores the return value so any errors are ignored. Reproduceable with `nxos_config/tests/common/src_invalid.yaml` Verified fix with `nxos_config/tests/common/src_*` tests. Ref: 71113ee#diff-7477bf046013758366cc85b06f90709aR43 * nxos_config/tests/common/src_basic: Updated to test with src This test was not actually testing with `src:` as it should have. * Revert 412d7e change to plugins/action/network.py PR #52912 fixed this already. * nxos_config: fix src_invalid test (cherry picked from commit d69239c)
SUMMARY
PR #50301 moved template error handling out of run() and into its own method in
handle_src_option
; however, after the change run() ignores the return value so any errors are ignored.My fix looks for error state and returns it if present. Verified fix with
nxos_config/tests/common/src_*
tests.Ref:
71113ee#diff-7477bf046013758366cc85b06f90709aR43
Also updated the
src_basic.yaml
test which didn't actually test withsrc:
before.ISSUE TYPE
COMPONENT NAME
plugins/action/network
ADDITIONAL INFORMATION
Reproduceable with
nxos_config/tests/common/src_invalid.yaml
. The symptom is that the src: string fails the template handling (as expected) but the string is sent to the device anyway.From
src_invalid.yaml
:Test output: