-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 VLAN_INTERFACE attach issue upon vlan id-name mismatch #1367
Conversation
6e1b2f8
to
dc6f190
Compare
can you add unit test this? #Resolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this PR. Because the issue was fixed earlier. Now we don't use the vintfname for anything. We use 'sonic_vlan_name' as key for Vlans. sonic_vlan_name is generated using VlanID without vlan_name
src/sonic-config-engine/minigraph.py
Outdated
@@ -398,9 +400,13 @@ def parse_xml(filename, platform=None, port_config_file=None): | |||
phyport_intfs = {} | |||
vlan_intfs = {} | |||
pc_intfs = {} | |||
vlan_invert_mapping = dict([[v['alias'],k] for k,v in vlans.items() if v.has_key('alias')]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be written as following
vlan_invert_mapping = {v['alias']: k for k, v in vlans.items() if v.has_key('alias')}
``` #Resolved
I think VLAN part has been fixed previously, but VLAN_INTERFACE part (the ip interfaces attached to vlan) was not. This fix is to fix parsing VLAN_INTERFACE from minigraph. #Closed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add unit test for this case?
- What I did
Together with #695, this will fix #1003.
- How I did it
When a Vlan has vlan name different with "Vlan"+id, it will be recorded as an alias. And when DPG is parsing, both "Vlan"+id and alias will be checked for "AttachTo" field.