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_optics broken if input value is N.A #1205

Closed
1 task done
ExaneServerTeam opened this issue May 11, 2020 · 0 comments · Fixed by #1206
Closed
1 task done

IOS: get_optics broken if input value is N.A #1205

ExaneServerTeam opened this issue May 11, 2020 · 0 comments · Fixed by #1206

Comments

@ExaneServerTeam
Copy link
Contributor

Description of Issue/Question

Exception is raised when running get_optics on Cisco iOS if the input value is N/A (Vs a float)

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

(Place an x between the square brackets where applicable)

  • Yes
  • [] No

Setup

napalm version

Latest Git

Network operating system version

Cisco IOS Software, s6t64 Software (s6t64-ADVENTERPRISEK9-M), Version 15.4(1)SY4, RELEASE SOFTWARE (fc3)

Steps to Reproduce the Issue

Error Traceback

INFO:root:Working on xxxxx
Traceback (most recent call last):
  File "/pythonspace/monitor-cisco/monitor.py", line 164, in <module>
    to_csv=args.to_csv)
  File "/Devel/pythonspace/monitor-cisco/monitor.py", line 96, in get_optics
    ifc_d = device.get_optics()
  File "/Devel/pythonspace/monitor-cisco/.venv/lib/python3.6/site-packages/napalm/ios/ios.py", line 802, in get_optics
    "instant": (float(input_power) if "input_power" else -100.0),
ValueError: could not convert string to float: 'N/A'
ExaneServerTeam added a commit to ExaneServerTeam/napalm that referenced this issue May 11, 2020
Extend the current check to ouput value to the input value.
Input value could also be N/A

Fixes napalm-automation#1205
ExaneServerTeam added a commit to ExaneServerTeam/napalm that referenced this issue May 11, 2020
Extend the current check to ouput value to the input value.
Input value could also be N/A

Fixes napalm-automation#1205
mirceaulinic pushed a commit that referenced this issue May 11, 2020
* 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
ExaneServerTeam added a commit to ExaneServerTeam/napalm that referenced this issue May 11, 2020
* 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 napalm-automation#1205

* Add test
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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant