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

[sonic-yang] W/A the feature "state" field validation #9587

Merged

Conversation

stepanblyschak
Copy link
Collaborator

Signed-off-by: Stepan Blyschak stepanb@nvidia.com

Why I did it

The feature state can be a jinja template, like in this file - https://github.com/Azure/sonic-buildimage/blob/master/files/build_templates/init_cfg.json.j2#L39.
Without this change it is not possible to validate a configuration file.

How I did it

Relaxes the constraint on feature state. Feature state leaf can be any string.

How to verify it

Run UT.

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

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

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
type string {
pattern "enabled|disabled|always_enabled|always_disabled";
}
type string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

string

The design of "The feature state can be a jinja template" is weird. What is the motivation? Is it in the design doc? #Pending

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@qiluo-msft I haven't found it. It is introduced in #6700. @tahmed-dev Could you please comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@qiluo-msft Issue - #9598

@stepanblyschak stepanblyschak changed the title [sonic-yang] fix the feature state type [sonic-yang] W/A the feature "state" field validation Dec 20, 2021
@liat-grozovik liat-grozovik added the Request for 202111 Branch For PRs being requested for 202111 branch label Dec 28, 2021
@liat-grozovik liat-grozovik merged commit 13582aa into sonic-net:master Dec 28, 2021
@qiluo-msft qiluo-msft added the YANG YANG model related changes label Jan 5, 2022
@judyjoseph
Copy link
Contributor

judyjoseph commented Jan 9, 2022

Please raise a new PR for 202111 as there are conflicts

stepanblyschak added a commit to stepanblyschak/sonic-buildimage that referenced this pull request Jan 17, 2022
- Why I did it
The feature state can be a jinja template, like in this file - https://github.com/Azure/sonic-buildimage/blob/master/files/build_templates/init_cfg.json.j2#L39.
Without this change it is not possible to validate a configuration file.

- How I did it
Relaxes the constraint on feature state. Feature state leaf can be any string.

- How to verify it
Run UT.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
@stepanblyschak
Copy link
Collaborator Author

@judyjoseph #9778

liat-grozovik pushed a commit to sonic-net/sonic-utilities that referenced this pull request Jan 17, 2022
…kages with YANG model (#1650)" (#1972)" (#1994)

This reverts commit fe00bbf.

- What I did
Revert previous revert, since the proposed fix has been merged - sonic-net/sonic-buildimage#9587

- How I did it
Revert the revert.

- How to verify it
Run build an on the switch.
judyjoseph pushed a commit that referenced this pull request Jan 23, 2022
- Why I did it
The feature state can be a jinja template, like in this file - https://github.com/Azure/sonic-buildimage/blob/master/files/build_templates/init_cfg.json.j2#L39.
Without this change it is not possible to validate a configuration file.

- How I did it
Relaxes the constraint on feature state. Feature state leaf can be any string.

- How to verify it
Run UT.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
liat-grozovik pushed a commit that referenced this pull request Jan 28, 2022
- Why I did it
The feature state can be a jinja template, like in this file - https://github.com/Azure/sonic-buildimage/blob/master/files/build_templates/init_cfg.json.j2#L39.
Without this change it is not possible to validate a configuration file.

- How I did it
Relaxes the constraint on feature state. Feature state leaf can be any string.

- How to verify it
Run UT.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
judyjoseph pushed a commit to sonic-net/sonic-utilities that referenced this pull request Jan 31, 2022
…kages with YANG model (#1650)" (#1972)" (#1994)

This reverts commit fe00bbf.

- What I did
Revert previous revert, since the proposed fix has been merged - sonic-net/sonic-buildimage#9587

- How I did it
Revert the revert.

- How to verify it
Run build an on the switch.
dbarashinvd pushed a commit to dbarashinvd/sonic-utilities that referenced this pull request Jul 11, 2022
…kages with YANG model (sonic-net#1650)" (sonic-net#1972)" (sonic-net#1994)

This reverts commit fe00bbf.

- What I did
Revert previous revert, since the proposed fix has been merged - sonic-net/sonic-buildimage#9587

- How I did it
Revert the revert.

- How to verify it
Run build an on the switch.
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this pull request Aug 3, 2023
…kages with YANG model (#1650)" (#1972)" (#1994)

This reverts commit fe00bbf63283ca6f3842e470b88cdc5b6d266a0d.

- What I did
Revert previous revert, since the proposed fix has been merged - sonic-net/sonic-buildimage#9587

- How I did it
Revert the revert.

- How to verify it
Run build an on the switch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Included in 202111 Branch Request for 202111 Branch For PRs being requested for 202111 branch YANG YANG model related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants