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 modern memory output from Arista EOS 4.27+ #1673

Merged
merged 2 commits into from
Jul 6, 2022

Conversation

optiz0r
Copy link
Contributor

@optiz0r optiz0r commented Jun 15, 2022

Arista EOS 4.27+ (and possibly earlier versions, untested on
4.24-4.26) changes the output from show processes top once
command, rendering values decimal numbers of MB instead of integer
numbers of KB, and also reorders the fields.

This commit extends the get_environment function with additional
logic to handle the output from both older and newer OS versions.

The memory expressed in MB is converted into KB for backward
compatibility, but because the switch has done some rounding and
displays only a limited number of decimal places, the conversion
into KB will not be exact. There is nothing that Napalm can do
about this.

Fixes #1671

@bewing
Copy link
Member

bewing commented Jun 21, 2022

Can you add a new test case to test/eos/mocked_data/test_get_environment as well?

Arista EOS 4.27+ (and possibly earlier versions, untested on
4.24-4.26) changes the output from `show processes top once`
command, rendering values decimal numbers of MB instead of integer
numbers of KB, and also reorders the fields.

This commit extends the `get_environment` function with additional
logic to handle the output from both older and newer OS versions.

The memory expressed in MB is converted into KB for backward
compatibility, but because the switch has done some rounding and
displays only a limited number of decimal places, the conversion
into KB will not be exact. There is nothing that Napalm can do
about this.

Includes test case for the new `show process top once` style output

Fixes napalm-automation#1671
@optiz0r
Copy link
Contributor Author

optiz0r commented Jun 22, 2022

Test case added, and commit updated

Copy link
Member

@bewing bewing left a comment

Choose a reason for hiding this comment

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

LGTM

@mirceaulinic mirceaulinic merged commit 6709ebf into napalm-automation:develop Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_environment on recent EOS crashes due to output changes
3 participants