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

The section filter does not exist on IOS 12.2(53r) #51845

Merged
merged 1 commit into from
Feb 8, 2019

Conversation

darren-jones-nz
Copy link
Contributor

SUMMARY

On IOS 12.2(53r) and probably others | section <keyword> doesn't exist leading to the below failure

fatal: [XXXXXXXXXXXXXXXXXX]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_QIulr4/ansible_module_ios_user.py\", line 409, in <module>\n main()\n File \"/tmp/ansible_QIulr4/ansible_module_ios_user.py\", line 382, in main\n have = map_config_to_obj(module)\n File \"/tmp/ansible_QIulr4/ansible_module_ios_user.py\", line 242, in map_config_to_obj\n data = get_config(module, flags=['| section username'])\n File \"/tmp/ansible_QIulr4/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py\", line 117, in get_config\n File \"/tmp/ansible_QIulr4/ansible_modlib.zip/ansible/module_utils/connection.py\", line 149, in __rpc__\nansible.module_utils.connection.ConnectionError: show running-config | section username\r\n ^\r\n% Invalid input detected at '^' marker.\r\n\r\nXXXXXXXXXXXXXXXXXXXX#\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}

A simple change to | include username fixes this.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ios_user

ADDITIONAL INFORMATION

This is a simple compatibility change to allow the ios_user module to work on IOS 12.2(53r)

The below is an example from 12.2(53r)

XXXXXXXXXXXXXXXXXX#show running-config | section username
                                         ^
% Invalid input detected at '^' marker.

XXXXXXXXXXXXXXXXXX#show running-config | include username
username xxxxxxxxx secret 5 nnnnnnnnnnnnnnnnnnnnnnnnnnn
username xxxxxxxxx secret 5 nnnnnnnnnnnnnnnnnnnnnnnnnnn

The below is an example from a device supporting | section <keyword>

XXXXXXXXXXXXXXXXXX#show running-config | section username
username xxxxxxxxx secret 4 nnnnnnnnnnnnnnnnnnnnnnnnnnnn
username xxxxxxxxx privilege 15 secret 4 nnnnnnnnnnnnnnnnnnnnnnnnnnnn
username xxxxxxxxx secret 5 nnnnnnnnnnnnnnnnnnnnnnnnnnnn


XXXXXXXXXXXXXXXXXX#show running-config | include username
username xxxxxxxxx secret 4 nnnnnnnnnnnnnnnnnnnnnnnnnnnn
username xxxxxxxxx privilege 15 secret 4 nnnnnnnnnnnnnnnnnnnnnnnnnnnn
username xxxxxxxxx secret 5 nnnnnnnnnnnnnnnnnnnnnnnnnnnn

@ansibot
Copy link
Contributor

ansibot commented Feb 6, 2019

@ansibot
Copy link
Contributor

ansibot commented Feb 6, 2019

@geraint-jones-nz, just so you are aware we have a dedicated Working Group for network.
You can find other people interested in this in #ansible-network on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@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. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. networking Network category new_contributor This PR is the first contribution by a new community member. small_patch support:network This issue/PR relates to code supported by the Ansible Network Team. traceback This issue/PR includes a traceback. labels Feb 6, 2019
@Qalthos
Copy link
Contributor

Qalthos commented Feb 7, 2019

This has been fixed in devel, but apparently missed getting backported to 2.7. Backport is in #51871

@Qalthos Qalthos closed this Feb 7, 2019
@Qalthos Qalthos reopened this Feb 8, 2019
@Qalthos Qalthos merged commit d1b2ef9 into ansible:devel Feb 8, 2019
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Feb 12, 2019
NilashishC added a commit that referenced this pull request Feb 27, 2019
@dagwieers dagwieers added ios Cisco IOS community and removed ios Cisco IOS community labels Feb 27, 2019
@dagwieers dagwieers added the cisco Cisco technologies label Feb 27, 2019
@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 module This issue/PR relates to a module. networking Network category new_contributor This PR is the first contribution by a new community member. small_patch 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.

None yet

5 participants