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

[yang] add yang options for Context object #10359

Merged
merged 1 commit into from
May 2, 2022

Conversation

ayurkiv-nvda
Copy link
Contributor

@ayurkiv-nvda ayurkiv-nvda commented Mar 27, 2022

Why I did it

Need to pass LY_CTX_DISABLE_SEARCHDIR_CWD to Context in order to disable automatically searching for schemas in current working directory (which is by default searched automatically)

How I did it

add additional attribute into YANG context

How to verify it

Create some invalid link on switch :

  1. ln -s /usr/abc xxx
  2. run spm list
    --> There should not be these messages:
libyang[1]: Unable to get information about "xxx" file in "/tmp" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "xxx" file in "/tmp" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "xxx" file in "/tmp" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "xxx" file in "/tmp" when searching for (sub)modules (No such file or directory)

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

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

Description for the changelog

Link to config_db schema for YANG module changes

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

@ayurkiv-nvda
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dprital dprital added the Request for 202111 Branch For PRs being requested for 202111 branch label Apr 4, 2022
@liat-grozovik
Copy link
Collaborator

@qiluo-msft could you please help to signoff?

@qiluo-msft
Copy link
Collaborator

qiluo-msft commented Apr 5, 2022

Could you explain more of the section "How to verify it"
The path "/usr/abc" is not existing.
What is spm?
You mentioned "LY_CTX_DISABLE_SEARCHDIR_CWD" but it does not appear in code.

@ayurkiv-nvda
Copy link
Contributor Author

ayurkiv-nvda commented Apr 7, 2022

Could you explain more of the section "How to verify it" The path "/usr/abc" is not existing. What is spm? You mentioned "LY_CTX_DISABLE_SEARCHDIR_CWD" but it does not appear in code.

spm in sonic-package-manager
LY_CTX_DISABLE_SEARCHDIR_CWD is used in related PR sonic-net/sonic-utilities#2118

@liat-grozovik
Copy link
Collaborator

@qiluo-msft could you please review following comments above?

@dgsudharsan dgsudharsan added the YANG YANG model related changes label Apr 11, 2022
@liat-grozovik
Copy link
Collaborator

@praveen-li could you please take a look on this PR as well?

@praveen-li
Copy link
Collaborator

praveen-li commented Apr 13, 2022 via email

Copy link
Collaborator

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

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

LGTM. Please wait for other reviewers.

@liat-grozovik
Copy link
Collaborator

@praveen-li kindly reminder to review this PR

@qiluo-msft qiluo-msft merged commit 0a6bb3f into sonic-net:master May 2, 2022
judyjoseph pushed a commit that referenced this pull request May 8, 2022
#### Why I did it
Need to pass LY_CTX_DISABLE_SEARCHDIR_CWD to Context in order to disable automatically searching for schemas in current working directory (which is by default searched automatically)

#### How I did it
add additional attribute into YANG context

#### How to verify it
Create some invalid link on switch :
1) **ln -s /usr/abc xxx**
2) run **spm list**
--> There should not be these messages:
```
libyang[1]: Unable to get information about "xxx" file in "/tmp" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "xxx" file in "/tmp" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "xxx" file in "/tmp" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "xxx" file in "/tmp" when searching for (sub)modules (No such file or directory)
```
liushilongbuaa pushed a commit to liushilongbuaa/sonic-buildimage that referenced this pull request Jun 20, 2022
#### Why I did it
Need to pass LY_CTX_DISABLE_SEARCHDIR_CWD to Context in order to disable automatically searching for schemas in current working directory (which is by default searched automatically)

#### How I did it
add additional attribute into YANG context

#### How to verify it
Create some invalid link on switch :
1) **ln -s /usr/abc xxx**
2) run **spm list**
--> There should not be these messages:
```
libyang[1]: Unable to get information about "xxx" file in "/tmp" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "xxx" file in "/tmp" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "xxx" file in "/tmp" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "xxx" file in "/tmp" when searching for (sub)modules (No such file or directory)
```
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.

10 participants