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

[202111] [YANG] Fix issue: Non compliant leaf list in config_db schema #10768

Merged

Commits on May 6, 2022

  1. [YANG] Fix issue: Non compliant leaf list in config_db schema (sonic-…

    …net#10291)
    
    Fix issue: Non compliant leaf list in config_db schema: sonic-net#9801
    
    The basic flow of DPB is like:
    1.	Transfer config db json value to YANG json value, name it “yangIn”
    2.	Validate “yangIn” by libyang
    3.	Generate a YANG json value to represent the target configuration, name it “yangTarget”
    4.	Do diff between “yangIn” and “yangTarget”
    5.	Apply the diff to CONFIG DB json and save it back to DB
    
    The fix:
    •	For step #1, If value of a leaf-list field string type, transfer it to a list by splitting it with “,” the purpose here is to make step#2 happy. We also need to save <table_name>.<key>.<field_name> to a set named “leaf_list_with_string_value_set”.
    •	For step#5, loop “leaf_list_with_string_value_set” and change those fields back to a string.
    
    1. Manual test
    2. Changed sample config DB and unit test passed
    
    Conflicts:
    	src/sonic-yang-mgmt/sonic_yang_ext.py
    Junchao-Mellanox committed May 6, 2022
    Configuration menu
    Copy the full SHA
    97d998a View commit details
    Browse the repository at this point in the history