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

Junos get_lldp_neighbor port returns the port-id, not the port-decription #1470

Merged

Conversation

chadell
Copy link
Contributor

@chadell chadell commented Jun 18, 2021

While working with get_lldp_neighbors for junos I noticed that the return value for port was misleading (at least for me), being actually the port-description instead the expected port-id.

I understand this could be a breaking change, so opening this PR to get feedback on this proposed change.

@chadell chadell closed this Jun 18, 2021
@chadell chadell reopened this Jun 18, 2021
@chadell chadell marked this pull request as ready for review June 18, 2021 08:54
@@ -104,7 +104,7 @@ junos_lldp_table:
junos_lldp_view:
fields:
hostname: lldp-remote-system-name
port: lldp-remote-port-description | lldp-remote-port-id
Copy link
Member

Choose a reason for hiding this comment

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

lldp-remote-port-description needs to stay as that's what older Junos versions provide.

@mirceaulinic
Copy link
Member

I left a suggested change, in order to avoid breaking the behaviour for older Junos. I'll also ask you to provide an additional test case (or rename the existing on to something like old_junos and provide a new one containing the <lldp-remote-port-id>27</lldp-remote-port-id> line).

@chadell
Copy link
Contributor Author

chadell commented Jun 18, 2021

@mirceaulinic , after reviewing the logic, I decided to implement a small change on get_lldp_neighbors, in order to get only the first element of a list, as it's actually how I understand the | operator.
Following your recommendation, I created an old version (without the <lldp-remote-port-id> tag), and kept the normal one, with both tags.

@chadell chadell requested a review from mirceaulinic June 18, 2021 12:58
Copy link
Member

@mirceaulinic mirceaulinic left a comment

Choose a reason for hiding this comment

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

Thanks @chadell!

@mirceaulinic mirceaulinic merged commit ec7565c into napalm-automation:develop Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants