-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 admin_status to BGP_NEIGHBOR_TEMPLATE_LIST. #9341
Conversation
Signed-off-by: Gang Lv [email protected]
20cec64
to
4c2218e
Compare
|
||
leaf admin_status { | ||
type boolean; | ||
description "To enable BGP peer"; |
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.
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.
Please add UT to cover this case
@@ -97,6 +97,11 @@ module sonic-bgp-neighbor { | |||
} | |||
description "Route reflector client"; | |||
} | |||
|
|||
leaf admin_status { | |||
type boolean; |
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.
I believe you should use the sonic type admin status as the values for the field will be 'up'/'down'
https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/yang-models/sonic-types.yang#L54
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.
leaf admin_status {
type stypes:admin_status;
}
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.
I believe you should use the sonic type admin status as the values for the field will be 'up'/'down' https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/yang-models/sonic-types.yang#L54
Good suggestion!
I used the same type as sonic-bgp-common.yang, and please refer to BGP_NEIGHBOR_LIST.
https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/yang-models/sonic-bgp-common.yang#L316-L319
Would you please confirm which type should be used?
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.
Per the above bgpcfgd module (refer above code), we should use 'up'/'down', please make the changes.
I can't find any UT for BGP_NEIGHBOR_TEMPLATE_LIST, current UT only covers BGP_NEIGHBOR_LIST. |
I am not sure. @venkatmahalingam Do you know? |
@venkatmahalingam Can you please review? |
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.
Let's make the admin_status type based on the backend implementation which is 'up'/'down'.
2. Add UT for NEIGHBOR_TEMPLATE_LIST. Signed-off-by: Gang Lv [email protected]
@@ -7,6 +7,11 @@ module sonic-bgp-neighbor { | |||
prefix inet; | |||
} | |||
|
|||
import sonic-types { | |||
prefix stypes; | |||
revision-date 2019-07-01; |
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.
Please remove the revision-date.
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.
Please address the comment.
Signed-off-by: Gang Lv [email protected]
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.
LGTM. Please also wait other active reviewers' approval.
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Azure.sonic-buildimage |
Commenter does not have sufficient privileges for PR 9341 in repo Azure/sonic-buildimage |
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Gang Lv [email protected]
Why I did it
#9119
BGP_NEIGHBOR_TEMPLATE_LIST does not have admin_status field.
How I did it
Add admin_status to BGP_NEIGHBOR_TEMPLATE_LIST.
How to verify it
Follow the steps in #9119.
Build sonic-yang-model.
Which release branch to backport (provide reason below if selected)
Description for the changelog
fix #9119
A picture of a cute animal (not mandatory but encouraged)