networktocode / ntc-rosetta

The missing bridge between industry standard CLIs and YANG
https://ntc-rosetta.readthedocs.io/en/latest/index.html
Apache License 2.0
103 stars 23 forks source link

Junos allow named vlan #8

Closed dgjustice closed 5 years ago

dgjustice commented 5 years ago

The current parser cannot handle vlans with no vlan-id and "named" vlans under the interface config. This PR adds a check for empty vlan-id tags and performs a lookup to map vlan-id to named vlans.

            <interface>
                <name>xe-0/0/1</name>
                <flexible-vlan-tagging/>
                <unit>
                    <name>0</name>
                    <family>
                        <ethernet-switching>
                            <interface-mode>trunk</interface-mode>
                            <vlan>
                                <members>VXLAN-1001</members>
                            </vlan>
                        </ethernet-switching>
                    </family>
                </unit>
            </interface>
...
            <vlan>
                <name>RECIRC-VXLAN-1000</name>
                <interface>
                    <name>xe-0/0/1.3</name>
                </interface>
                <interface>
                    <name>ae67.3</name>
                </interface>
            </vlan>
            <vlan>
                <name>VXLAN-1001</name>
                <vlan-id>1001</vlan-id>
                <vxlan>
                    <vni>1001</vni>
                    <ingress-node-replication/>
                </vxlan>
            </vlan>
dbarrosop commented 5 years ago

Do you need help here?

dgjustice commented 5 years ago

Sorry, got busy with $day_job. I'm going to poke at this some this week. Trying to get through the test cases right now. Feel free to comment if you see anything obvious that I missed!

dgjustice commented 5 years ago

It's passing tests now, ready for review.

dbarrosop commented 5 years ago

Awesome!