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

fix interface speed 0 error #242

Merged

Conversation

cwaynej
Copy link
Contributor

@cwaynej cwaynej commented Mar 19, 2024

When reading junos_interface_speed{} on 1000 Mbps interfaces, the string Mbps doesn't match mbps & there is a white space between 1000 and Mbps which would result in 10 000000

Example from a QFX5100

1000 Mbps

> show interfaces xe-0/0/47 extensive | display xml | grep speed 
            <speed>1000 Mbps</speed>
                <link-partner-speed>1000 Mbps</link-partner-speed>

Since we don't match mbps, speed := "0" remains true.

This PR lowers Mbps to mbps before comparing && replaces all whitespaces in the end.

This is my first PR to this repository. Please let me know if I might have missed any guidelines.

Thanks
Chris

@cwaynej cwaynej requested a review from czerwonk as a code owner March 19, 2024 21:02
Copy link
Owner

@czerwonk czerwonk left a comment

Choose a reason for hiding this comment

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

LGTM

@czerwonk czerwonk merged commit 8ff27e0 into czerwonk:main Mar 28, 2024
3 checks passed
@cwaynej cwaynej deleted the bugfix/cwaynej/interfaces_speed_1gbps branch March 29, 2024 12:56
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 this pull request may close these issues.

2 participants