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

Handle Duplex parsing on some version of iosxr #38738

Merged
merged 2 commits into from Apr 18, 2018

Conversation

gdpak
Copy link
Contributor

@gdpak gdpak commented Apr 13, 2018

Fixes #38653

SUMMARY

Some version of iosxr ( I think post 5.3) have different duplex pattern in show interface

ISSUE TYPE
  • Bugfix Pull Request

@ansibot
Copy link
Contributor

ansibot commented Apr 13, 2018

@ansibot ansibot added 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 owner_pr This PR is made by the module's maintainer. support:network This issue/PR relates to code supported by the Ansible Network Team. labels Apr 13, 2018
@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Apr 13, 2018
@auerswal
Copy link

Hi,

I think this PR implements an overly complex solution. I would suggest to just modify the regular expression to extract the duplex status as follows:

-match = re.search(r'(\w+) Duplex', data, re.M)
+match = re.search(r'(\w+)(?: D|-d)uplex', data, re.M)

Note: This is untested, but I'd call this obviously correct. ;-)

Thanks,
Erik

@gdpak gdpak merged commit bdd105f into ansible:devel Apr 18, 2018
@gdpak gdpak deleted the iosxr_facts_duplex branch April 18, 2018 07:52
ilicmilan pushed a commit to ilicmilan/ansible that referenced this pull request Nov 7, 2018
* Handle Duplex parsing on some version of iosxr

* use re noncapture group for multiple match as suggested by Eric
@dagwieers dagwieers added iosxr Cisco IOSXR community cisco Cisco technologies labels Feb 22, 2019
@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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. iosxr Cisco IOSXR community module This issue/PR relates to a module. networking Network category owner_pr This PR is made by the module's maintainer. support:network This issue/PR relates to code supported by the Ansible Network Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iosxr_facts can't parse interface duplex status on ARS9001 and 9904 with older firmware
6 participants