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

Add get_vlans for Junos #1398

Merged
merged 5 commits into from
Mar 22, 2021

Conversation

minefuto
Copy link
Contributor

I add get_vlans for Junos because #1367 is inactivity.

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.

That's great @minefuto, thanks for taking over. Looks good, just a small detail I'm curious about otherwise this should be good.

return result

vlan.get()
unmatch_pattern = "l2rtb-interface-name|None|l2ng-l2rtb-vlan-member-interface"
Copy link
Member

Choose a reason for hiding this comment

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

I suppose there are different formats to match because of various switch styles? Is None a possibility? If so, would you have access to a device to add another test case for that one too?

Copy link
Contributor Author

@minefuto minefuto Mar 20, 2021

Choose a reason for hiding this comment

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

It returns different values depending on switch_style if there is not binding IF of vlan.
BRIDGE_DOMAIN: l2rtb-interface-name
VLAN: None(string)
VLAN_L2NG: l2ng-l2rtb-vlan-member-interface

I think I have already added the above 3 patterns as a VLAN300 per switch_style.
BRIDGE_DOMAIN, VLAN, VLAN_L2NG

Also, I found an exception on MX(switch_style:BRIDGE_DOMAIN).
It seems it's possible that MX returns None(NoneType) if there is not binding IF of vlan.
I added this pattern only BRIDGE_DOMAIN by f519d24, 09fe92f because I could not found this exception in the others switch_style.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense, thank you @minefuto!

@mirceaulinic mirceaulinic merged commit ba5b267 into napalm-automation:develop Mar 22, 2021
@minefuto minefuto deleted the junos_get_vlans branch March 22, 2021 14:52
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.

2 participants