forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 3
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
[_sonic_yang_ext.py]: Extend sonic yang class to support cropping, transalation, reverse translation of … #11
Merged
zhenggen-xu
merged 10 commits into
zhenggen-xu:sonic-cfg-mgmt
from
praveen-li:sonic_yang_extension
Dec 11, 2019
Merged
[_sonic_yang_ext.py]: Extend sonic yang class to support cropping, transalation, reverse translation of … #11
zhenggen-xu
merged 10 commits into
zhenggen-xu:sonic-cfg-mgmt
from
praveen-li:sonic_yang_extension
Dec 11, 2019
Conversation
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
…config. From the json format of yang models, a map is created from config DB tables to container in yang model. Input Config is cropped on based of this map.
Test code for copping config DB. Minor fixes in other files.
…yang model. Load data in sonic_yang after transalation. Test for translation functionality.
Added config DB json sample in yangTest.json. Blocked other PLY test cases as of now, because they fail with new yang models.
praveen-li
changed the title
[_sonic_yang_ext.py]: Extend sonic yang class to support cropping of …
[_sonic_yang_ext.py]: Extend sonic yang class to support cropping, transalation of …
Dec 4, 2019
…ig DB json. Reverse translation i.e. from YANG json to Config DB json based on yang models. Find xpath for a port. portleaf and a yang list. get_data functions to get rev xlated data from data tree. Test for crop, xlate and rev xlate.
praveen-li
changed the title
[_sonic_yang_ext.py]: Extend sonic yang class to support cropping, transalation of …
[_sonic_yang_ext.py]: Extend sonic yang class to support cropping, transalation, reverse translation of …
Dec 4, 2019
zhenggen-xu
reviewed
Dec 5, 2019
li-pingmao
reviewed
Dec 6, 2019
li-pingmao
reviewed
Dec 6, 2019
src/sonic-yang-mgmt/tests/libyang-python-tests/test_sonic_yang.py
Outdated
Show resolved
Hide resolved
li-pingmao
reviewed
Dec 6, 2019
li-pingmao
reviewed
Dec 6, 2019
li-pingmao
reviewed
Dec 6, 2019
li-pingmao
reviewed
Dec 6, 2019
li-pingmao
reviewed
Dec 6, 2019
li-pingmao
reviewed
Dec 6, 2019
li-pingmao
reviewed
Dec 6, 2019
li-pingmao
reviewed
Dec 6, 2019
li-pingmao
reviewed
Dec 6, 2019
li-pingmao
reviewed
Dec 9, 2019
… slave docker. Fix the test to accomodate for ip-prefix as of now
li-pingmao
approved these changes
Dec 10, 2019
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.
will open a separate ticket for generic function to get xpath from table name and key etc
Unblocking PLY test cases.
li-pingmao
approved these changes
Dec 11, 2019
zhenggen-xu
pushed a commit
that referenced
this pull request
Jan 10, 2020
…ansalation, reverse translation of … (#11) * [_sonic_yang_ext.py]: Extend sonic yang class to support cropping of config. From the json format of yang models, a map is created from config DB tables to container in yang model. Input Config is cropped on based of this map. * [test_sonic_yang.py]: Test code for sonic yang extension funtionalities. Test code for copping config DB. Minor fixes in other files. * [_sonic_yang_ext.py]: Translate Config DB format to YANG json as per yang model. Load data in sonic_yang after transalation. Test for translation functionality. * [test_sonic_yang.py]: Add test for translation. Added config DB json sample in yangTest.json. Blocked other PLY test cases as of now, because they fail with new yang models. * [_sonic_yang_ext.py]: Reverse translation i.e. from YANG json to Config DB json. Reverse translation i.e. from YANG json to Config DB json based on yang models. Find xpath for a port. portleaf and a yang list. get_data functions to get rev xlated data from data tree. Test for crop, xlate and rev xlate. * [_sonic_yang_ext.py]: Minor changes to handle exceptions. * [build_debian.sh]: Add neccessary package in sonic image and in sonic slave docker. Fix the test to accomodate for ip-prefix as of now * [_sonic_yang_ext.py]: Addressing more exception handling and comments. Unblocking PLY test cases. * [setup.py]: Add _sonic_yang_ext.py in package. * [test_sonic_yang.py]: Fixing test case for delete node.
praveen-li
pushed a commit
to praveen-li/sonic-buildimage
that referenced
this pull request
Aug 12, 2020
* src/sonic-telemetry fa8d498...3bd7ca3 (4): > Update gnmi deps (zhenggen-xu#40) > [testdata] Update SFP keys to align with new standard (zhenggen-xu#39) > Fixed the parameters for subscribe APIs (zhenggen-xu#38) > Azure ro mode (zhenggen-xu#34) * src/sonic-mgmt-common 444aa9a...cc01ce4 (4): > Make gnmi dep version the same as in telemetry repo (zhenggen-xu#17) > Cleanup translib and cvl go test cases (zhenggen-xu#13) > Package update and enhancements/fixes in YGOT, and Request Binder (zhenggen-xu#12) > Translib phase I changes (zhenggen-xu#11) Note: sonic-telemetry submodule update is dependent upon sonic-mgmt-common submodule update, thus updating both in this patch
li-pingmao
pushed a commit
to li-pingmao/sonic-buildimage
that referenced
this pull request
Feb 23, 2022
* [BFN] Updated platform APIs impl Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com> * Extended BFN platform SFP APIs implementation * Update sfp.py * [BFN] Extended SFP platform plugin implementation Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com> * [BFN] Extended Fans platform plugin implementation * [BFN] divided classes Fan and FanDrawer into 2 files * Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com> What I did Add get_model() function Add get_low_critical_threshold() function Change __get(...) function. How I did it Differnece from previous implementation of __get(...) function is return real value or -9999.9 if value is not provided by thrift API * Add get_presence() function and revised __get() function Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com> * [BFN] Updated PSU platform APIs impl Signed-off-by: Dmytro Lytvynenko <dmytrox.lytvynenko@intel.com> * Added BFN PSU cache (zhenggen-xu#9) Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com> * [BFN] Fans and Fantray platform APIs update (zhenggen-xu#7) * [BFN] Updated SFP platform APIs (zhenggen-xu#10) Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com> * [BFN] Updated platform API for thermal (zhenggen-xu#8) * Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com> * Revert "[BFN] Fans and Fantray platform APIs update (zhenggen-xu#7)" (zhenggen-xu#11) This reverts commit c62a733. * Add support health monitor system (zhenggen-xu#15) Signed-off-by: Petro Bratash <petrox.bratash@intel.com> * Update chassis.py * [BFN] Updated FANs and FAN Tray platform API (zhenggen-xu#14) * Fix fix_alignment (zhenggen-xu#17) Signed-off-by: Petro Bratash <petrox.bratash@intel.com> * [BFN] Improvement show environment (zhenggen-xu#16) * Added PSU temperature skip into platform.json (zhenggen-xu#18) Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com> * Do not skip psud on Newport Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com> * [BFN] fix fan status from Not OK to Ok (zhenggen-xu#19) * [BFN] Updated SFP platform plugin (zhenggen-xu#13) Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com> * [DPB] Fix typo for Ethernet0 2x200G[100G,40G] breakout mode (zhenggen-xu#21) Signed-off-by: Mykola Gerasymenko <mykolax.gerasymenko@intel.com> * [barefoot] Tmp fix vendor_rev (zhenggen-xu#22) Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com> * Fixed python issues in sonic_platform/fan_drawer.py Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com> * Updated fan_drawer.py * Fixing trailing white spaces in fan_drawer.py * [BFN] Fix thrift for SFPs API Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com> * In platform.json, replaced 'false' with '0' to workaround ast.literal_eval() issue Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com> * [Newport] Thermal manager (zhenggen-xu#23) * Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com> * Revert "In platform.json, replaced 'false' with '0' to workaround ast.literal_eval() issue" This reverts commit 1e73127. * Removed 'controllable' options from platform.json to fix factory default config generation Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com> * Update thermal_manager.py * Migrated SFP plugin to sonic_xcvr API (zhenggen-xu#30) Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com> Co-authored-by: KostiantynYarovyiBf <kostiantynx.yarovyi@intel.com> Co-authored-by: Vadym Yashchenko <vadymx.yashchenko@intel.com> Co-authored-by: Dmytro Lytvynenko <dmytrox.lytvynenko@intel.com> Co-authored-by: Volodymyr Boiko <volodymyrx.boiko@intel.com> Co-authored-by: Petro Bratash <petrox.bratash@intel.com> Co-authored-by: Mykola Gerasymenko <mykolax.gerasymenko@intel.com>
li-pingmao
pushed a commit
to li-pingmao/sonic-buildimage
that referenced
this pull request
Feb 23, 2022
[sonic-linkmgrd][master] submodule update Commits added: 0c23756 Jing Zhang 2022-01-19 Linkmgrd subscribing State DB route event (zhenggen-xu#13) 12b9951 Longxiang Lyu 2021-12-13 Add TLV support to ICMP payload (zhenggen-xu#11) 3eedda3 Longxiang Lyu 2022-01-06 Add missing intermediate states (zhenggen-xu#16) 8da4982 Ying Xie 2022-01-04 [linkmgrd] update README, set coding style guidance (zhenggen-xu#15) a897cf8 Longxiang Lyu 2021-12-13 Improve PR template (zhenggen-xu#16) 6fec701 Jing Zhang 2021-12-06 Add pull request template for linkmgrd repo (zhenggen-xu#9) signed-off-by: Jing Zhang zhangjing@microsoft.com
praveen-li
pushed a commit
to praveen-li/sonic-buildimage
that referenced
this pull request
Dec 23, 2022
[sonic-linkmgrd][master] submodule update Commits added: 0c23756 Jing Zhang 2022-01-19 Linkmgrd subscribing State DB route event (zhenggen-xu#13) 12b9951 Longxiang Lyu 2021-12-13 Add TLV support to ICMP payload (zhenggen-xu#11) 3eedda3 Longxiang Lyu 2022-01-06 Add missing intermediate states (zhenggen-xu#16) 8da4982 Ying Xie 2022-01-04 [linkmgrd] update README, set coding style guidance (zhenggen-xu#15) a897cf8 Longxiang Lyu 2021-12-13 Improve PR template (zhenggen-xu#16) 6fec701 Jing Zhang 2021-12-06 Add pull request template for linkmgrd repo (zhenggen-xu#9) signed-off-by: Jing Zhang zhangjing@microsoft.com
praveen-li
pushed a commit
to praveen-li/sonic-buildimage
that referenced
this pull request
Dec 23, 2022
Signed-off-by: ankgoyal <ankgoyal@cisco.com>
zhenggen-xu
pushed a commit
that referenced
this pull request
May 24, 2024
Why I did it Advance dhcpmon to a3c5381 in 202305 branch. a3c5381 - (HEAD, origin/master, origin/HEAD, master) Merge pull request src: Add libnl3 build.sh script #11 from jcaiMR/dev/jcai_fix_err_log (11 days ago) [StormLiangMS] c5ef7e7 - Change common_libs dependencies from buster to bullseye (Updating docker-orchagent/syncd Dockerfile and start.sh #9) 824a144 - replace atoi with strtol (Rename hostname #6) (10 weeks ago) [Mai Bui] 32c0c3f - Fix libswsscommon package installation for non-amd64 (README.md leaves out docker-database #7) (10 weeks ago) [Saikrishna Arcot] Work item tracking Microsoft ADO (25048723): How I did it How to verify it Run test_dhcp_relay.py, no failure
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…config DB.
From the json format of yang models, a map is created from config DB tables
to container in yang model. Input Config is cropped on based of this map.
Input Config is also translated based of this map.
Similarly from yang data tree, output is reverse translated to config DB.
This PR also includes:
-- Find xpath of port, portleaf and a yang list.
-- Find if node is key of a list while deletion if yes, then delete the parent.
- What I did
-- Cropping input config based on Yang Model.
-- Translate input config based on Yang Model.
-- rev Translate input config based on Yang Model.
-- Find xpath of port, portleaf and a yang list.
-- Find if node is key of a list while deletion if yes, then delete the parent.
- How I did it
Yang model can be represented in JSON as below:
This is used to create a map between Config DB Table and YANG Model Container.
Note: As per guideline https://github.com/Azure/SONiC/blob/master/doc/mgmt/SONiC_YANG_Model_Guidelines.md. Table maps to only container in YANG.
Map and json format of yang model is used to:
-- Cropping input config based on Yang Model.
-- Translate input config based on Yang Model.
-- rev Translate input config based on Yang Model.
-- Find xpath of port, portleaf and a yang list.
-- Find if node is key of a list while deletion if yes, then delete the parent.
- How to verify it
Added PyTest:
Below are sample config and cropped config files.
Cropped Config
Results will be added after PR #12 merge.
Translated Config:
Rev Translated config