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

Fix network config module invalid src option error #52912

Merged
merged 1 commit into from
Feb 25, 2019

Conversation

ganeshrn
Copy link
Member

@ganeshrn ganeshrn commented Feb 25, 2019

SUMMARY

Fixes #52911

Raise AnsibleError exception if the file
path mentioned in src option is not found or
failed to load the file

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ios_config

ADDITIONAL INFORMATION

Before:

{
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/var/folders/8l/27cd4l3n2vnc2cpk3498__680000gp/T/ansible_ios_config_payload_iFCCGp/ansible_ios_config_payload.zip/ansible/module_utils/connection.py\", line 186, in __rpc__\nansible.module_utils.connection.ConnectionError: abc/ios_config.cfg\r\n                   ^\r\n% Invalid input detected at '^' marker.\r\n\r\nan-ios-02(config)#\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

After:

{
    "msg": {
        "failed": true,
        "msg": "path specified in src not found"
    }
}

Fixes ansible#52911

Raise AnsibleError execption if the file
path mentioned in src option in not found or
failed to load
@ansibot
Copy link
Contributor

ansibot commented Feb 25, 2019

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team. traceback This issue/PR includes a traceback. labels Feb 25, 2019
Copy link
Member Author

@ganeshrn ganeshrn left a comment

Choose a reason for hiding this comment

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

@justjais Thank you for review

@ganeshrn ganeshrn merged commit cb67235 into ansible:devel Feb 25, 2019
@dagwieers dagwieers added ios Cisco IOS community cisco Cisco technologies labels Feb 27, 2019
chrisvanheuveln added a commit to chrisvanheuveln/ansible that referenced this pull request Feb 27, 2019
ganeshrn pushed a commit that referenced this pull request Feb 28, 2019
…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
trishnaguha pushed a commit to trishnaguha/ansible that referenced this pull request Apr 1, 2019
…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)
abadger pushed a commit that referenced this pull request Apr 4, 2019
…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)
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cisco Cisco technologies core_review In order to be merged, this PR must follow the core review workflow. ios Cisco IOS community networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ios_config module fails with wrong error for invalid src option
4 participants