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

Support Grouping translation in YANG Models. #8318

Merged
merged 1 commit into from
Sep 30, 2021

Conversation

praveen-li
Copy link
Member

[sonic_yang_ext.py]: Support Grouping translation in YANG Models.
Changes:
-- pre Process Grouping section from all yang models, so it can be used
from any yang model.
-- add jsondiff in setup.py, it is useful for test debugging in case of
failures.
-- use 'stypes' instead of head.
-- pass config DB table name in _createLeafDict().
-- added test config for grouping.
-- white spaces changes.

Note: Changes are done in the way that we can add supoort for other
Generic YANG statement easily for tranlation.

Signed-off-by: Praveen Chaudhary [email protected]

Why I did it

Need to support Grouping translation in YANG Models.

How I did it

Changes:
-- pre Process Grouping section from all yang models, so it can be used
from any yang model. File: src/sonic-yang-mgmt/sonic_yang_ext.py

-- add jsondiff in setup.py, it is useful for test debugging in case of
failures.
-- use 'stypes' instead of head.
-- pass config DB table name in _createLeafDict().
-- added test config for grouping.
-- white spaces changes.

How to verify it

Added Build Time Tests: File: src/sonic-yang-models/tests/files/sample_config_db.json

Build the PKG.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

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

@praveen-li praveen-li requested a review from lguohan as a code owner August 3, 2021 19:35
@praveen-li praveen-li force-pushed the xlation_Grouping branch 3 times, most recently from 20787ac to 741a59d Compare August 3, 2021 20:31
@praveen-li
Copy link
Member Author

@jleveque : can you help in running the Azure pipeline again, seems like temporary failure. Thanks a lot.

@praveen-li
Copy link
Member Author

@qiluo-msft, @renukamanavalan : not sure, who is the right person to review this PR.
But since it unblocks couple of yang model PRs, and is a useful feature in Yang. So Kindly assign someone to review it. Thanks a ton for help.

@qiluo-msft
Copy link
Collaborator

@arlakshm Could you help review?

Changes:
 -- pre Process Grouping section from all yang models, so it can be used
from any yang model.
-- add jsondiff in setup.py, it is useful for test debugging in case of
failures.
-- use 'stypes' instead of head.
-- pass config DB table name in _createLeafDict().
-- added test config for grouping.
-- white spaces changes .

Note: Changes are done in the way that we can add supoort for other
Generic YANG statement easily for tranlation.

Signed-off-by: Praveen Chaudhary [email protected]
@praveen-li
Copy link
Member Author

Rebased to rerun Azure Pipeline

@qiluo-msft
Copy link
Collaborator

PR owner could use /apzw run to trigger the Azure pipeline build checkers.
This feature is enabled on this repo and several other sonic repoes.

Copy link
Contributor

@arlakshm arlakshm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@arlakshm arlakshm merged commit 83108d9 into sonic-net:master Sep 30, 2021
ghooo added a commit to sonic-net/sonic-utilities that referenced this pull request Feb 23, 2022
#### What I did
Fixes #2041

Supporting groupings during `config-db path` <-> `config-yang xpath` translation

This mimics the `config-db` <-> `config-yang`  translation as added by sonic-net/sonic-buildimage#8318

#### How I did it
Handled groupings of leaf commands only as that's what is supported in sonic-yang-mgmt

#### How to verify it
unit-test

#### Previous command output (if the output of a command-line utility has changed)

#### New command output (if the output of a command-line utility has changed)
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this pull request Aug 3, 2023
#### What I did
Fixes #2041

Supporting groupings during `config-db path` <-> `config-yang xpath` translation

This mimics the `config-db` <-> `config-yang`  translation as added by sonic-net/sonic-buildimage#8318

#### How I did it
Handled groupings of leaf commands only as that's what is supported in sonic-yang-mgmt

#### How to verify it
unit-test

#### Previous command output (if the output of a command-line utility has changed)

#### New command output (if the output of a command-line utility has changed)
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.

3 participants