Skip to content

[minigraph.py]: Remove members list from VLAN, it is not supported in YANG models. #8753

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

praveen-li
Copy link
Member

@praveen-li praveen-li commented Sep 14, 2021

- What I did
Remove members list from VLAN, it is not supported in YANG models.

minigraph.py generates config_db json data from minigraph, today it also
generates vlan['members'] field which is invalid as per YANG models.
This PR removes VLAN['members'] from json format.

Related Command: sonic-cfggen -H -m /etc/sonic/minigraph.xml --print-data

- How I did it
Let vlan['members'] get filled in parse_dpg(), but remove it from json before assignment in result in function parse_xml().

- How to verify it
Before Fix:

sonic-cfggen -H -m /etc/sonic/minigraph.xml --print-data | grep -A 20 VLAN
–
"VLAN": {
  "Vlan1000": {
      "vlanid": "1000",
      "dhcp_servers": [ "192.0.0.1", "192.0.0.2", "192.0.0.3", "192.0.0.4" ],
      "members": [
        "Ethernet4",
        "Ethernet8",
        "Ethernet12",
–

After Fix:
sonic-cfggen -H -m /etc/sonic/minigraph.xml --print-data | grep -A 20 VLAN

--
"VLAN": {
  "Vlan1000": { 
     "vlanid": "1000", 
     "dhcp_servers": [ "192.0.0.1", "192.0.0.2", "192.0.0.3", "192.0.0.4" ] 
   }
},

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

YANG models.

minigraph.py generates config_db json data from minigraph, today it also
generates vlan['members'] field which is invalid as per YANG models.
This PR removes VLAN['members'] from json format.

Signed-off-by: Praveen Chaudhary <[email protected]>
RB=
G=lnos-reviewers
R=pchaudhary,pmao,samaity,zxu
A=
@praveen-li praveen-li requested a review from lguohan as a code owner September 14, 2021 17:31
@praveen-li praveen-li requested a review from a team as a code owner June 10, 2022 02:01
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