-
Notifications
You must be signed in to change notification settings - Fork 672
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[config/config_mgmt.py]: Fix dpb issue with upper case mac in (#2066)
device_metadata. libYang converts ietf yang types to lower case internally,which creates false config diff for us while DPB. This PR fixes the issue by not precessing false diff. Related issue" sonic-net/sonic-buildimage#9478 #### What I did fixes issue: sonic-net/sonic-buildimage#9478 #### How I did it libYang converts ietf yang types to lower case internally,which creates false config diff for us while DPB. Example: For DEVICE_METADATA['localhost']['mac'] type is yang:mac-address. Libyang converts from 'XX:XX:XX:E4:B3:DD' -> 'xx:xx:xx:e4:b3:dd' so args for function _recurCreateConfig in this case will be: diff = DEVICE_METADATA['localhost']['mac'] where DEVICE_METADATA': {'localhost': {'mac': ['XX:XX:XX:E4:B3:DD', 'xx:xx:xx:e4:b3:dd']}}} Note: above dict is representation of diff in config given by diffJson library. out = 'XX:XX:XX:e4:b3:dd' inp = 'xx:xx:xx:E4:B3:DD' I add a check to avoid processing of such config diff for DPB. #### How to verify it Added a unit test. Build time.
- Loading branch information
Praveen Chaudhary
authored
Apr 8, 2022
1 parent
9e2fbf4
commit 52ca324
Showing
2 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters