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

IOS: get_interfaces_counters broken with Managment Interface #1200

Closed
ExaneServerTeam opened this issue May 8, 2020 · 3 comments · Fixed by #1201
Closed

IOS: get_interfaces_counters broken with Managment Interface #1200

ExaneServerTeam opened this issue May 8, 2020 · 3 comments · Fixed by #1201
Milestone

Comments

@ExaneServerTeam
Copy link
Contributor

Environment

Description of Issue/Question

Driver: ios
On call device.get_interfaces_counters() a KeyError is raised on Managment0 beeing missing

This is due to the Managment interface mgmt0 not beeing translated to canonical.

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

(Place an x between the square brackets where applicable)

  • [w] Yes
  • [] No

Setup

napalm version

Git Current Develop

Network operating system version

Cisco IOS Software, s6t64 Software (s6t64-ADVENTERPRISEK9-M), Version 15.5(1)SY4, RELEASE SOFTWARE (fc4)
Cisco C6807-XL ( Intel(R) Core(TM) i3-3227U CPU @ 2.50GHz ) processor (revision ) with 2879443K/524288K bytes of memory

Steps to Reproduce the Issue

call to device.get_interfaces_counters()

Error Traceback

Traceback (most recent call last):
  File "list-vlan2.py", line 19, in <module>
    print(yaml.dump(device.get_interfaces_counters()))
  File "/srv/home/adm-brin-f/Devel/pythonspace/test-napalm/.venv/lib/python3.6/site-packages/napalm/ios/ios.py", line 2133, in get_interfaces_counters
    counters[interface]["rx_discards"] = int(match.group("IQD"))
KeyError: 'Management0'
@mirceaulinic mirceaulinic added this to the APPROVED milestone May 8, 2020
@mirceaulinic
Copy link
Member

Hey @ExaneNetworkTeam - if you submit a PR by mid next week, I'll make sure to release it with 3.0.1. :-)
Out of curiosity: are you seeing this bug with 2.5.0?

ExaneServerTeam added a commit to ExaneServerTeam/napalm that referenced this issue May 8, 2020
Fixes napalm-automation#1200

mgmt0 interface is not translated to it's canonical name
on the 'show interface' command.

Thix fix attempt to use the expected Canonical name first
and fallback to the interface name in case of a KeyError is
raised
@ExaneServerTeam
Copy link
Contributor Author

@mirceaulinic Pull request available

I can confirm that the bug is not triggered with 2.5.0.

@mirceaulinic
Copy link
Member

mirceaulinic commented May 8, 2020 via email

mirceaulinic pushed a commit that referenced this issue May 9, 2020
* IOS: fix get_interfaces_counters when interface = canonical

Fixes #1200

mgmt0 interface is not translated to it's canonical name
on the 'show interface' command.

Thix fix attempt to use the expected Canonical name first
and fallback to the interface name in case of a KeyError is
raised

* Add test

* Make black happy !
mirceaulinic added a commit that referenced this issue May 15, 2020
* Bugfix/ios get interfaces counters mgmt0 (#1201)

* IOS: fix get_interfaces_counters when interface = canonical

Fixes #1200

mgmt0 interface is not translated to it's canonical name
on the 'show interface' command.

Thix fix attempt to use the expected Canonical name first
and fallback to the interface name in case of a KeyError is
raised

* Add test

* Make black happy !

* Version 3.0.1 (#1202)

* Junos: close configuration in case configure_private is set to avoid configure session to stay forever. (#1199)

This is done in commit_config  and discard_config functions.

Co-authored-by: Mircea Ulinic <mirceaulinic@users.noreply.github.com>

* Bugfix/ios get optics input na (#1206)

* IOS: fix get_optics when input is N/A

Extend the current check to ouput value to the input value.
Input value could also be N/A

Fixes #1205

* Add test

* Bugfix/ios get optics support vss (#1208)

* IOS: support get_optics on VSS Setup

Introduce a new class function: _is_vss

If the current swith is a VSS setup, run
the following commands an parse the output::

    show interfaces transceiver switch 1
    show interfaces transceiver switch 2

* Add test

* Make black happy

* Bump pytest from 5.4.1 to 5.4.2 (#1204)

Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.4.1 to 5.4.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@5.4.1...5.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Mircea Ulinic <mirceaulinic@users.noreply.github.com>

* Update README.md and setup.py so branch has some differences (#1209)

* Fix cmd_verify and null character on NX-OS (#1214)

* Bump ddt from 1.3.1 to 1.4.1 (#1219)

Bumps [ddt](https://github.com/datadriventests/ddt) from 1.3.1 to 1.4.1.
- [Release notes](https://github.com/datadriventests/ddt/releases)
- [Commits](datadriventests/ddt@1.3.1...1.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Add eos_fn0039_config optional arg to toggle FN 0039 on config commands (#1212)

Co-authored-by: Kirk Byers <ktbyers@twb-tech.com>

Co-authored-by: Exane Server Team <frederic.brin@exane.com>
Co-authored-by: spinoshi <simone.spinelli@geant.org>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Kirk Byers <ktbyers@twb-tech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants