Skip to content

Commit

Permalink
[_sonic_yang_ext.py]: Extend sonic yang class to support cropping, tr…
Browse files Browse the repository at this point in the history
…ansalation, reverse translation of … (sonic-net#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.
  • Loading branch information
Praveen Chaudhary authored and zhenggen-xu committed Dec 11, 2019
1 parent d3fb685 commit 1b033f0
Show file tree
Hide file tree
Showing 8 changed files with 2,029 additions and 25 deletions.
4 changes: 4 additions & 0 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install 'docker
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install gcc libpython2.7-dev
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install 'netifaces==0.10.7'

# Get package to support Dynamic Port Breakout
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install xmltodict
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install jsondiff

## Create /var/run/redis folder for docker-database to mount
sudo mkdir -p $FILESYSTEM_ROOT/var/run/redis

Expand Down
1 change: 1 addition & 0 deletions sonic-slave-stretch/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ RUN pip install setuptools==40.8.0

# For sonic_yang_mgmt build
RUN pip install ijson
RUN pip install jsondiff

# Install dependencies for isc-dhcp-relay build
RUN apt-get -y build-dep isc-dhcp
Expand Down
Loading

0 comments on commit 1b033f0

Please sign in to comment.