-
Notifications
You must be signed in to change notification settings - Fork 54
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
GNOI Implementation of OS.Verify #342
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
56ad495
gnoi_client code.
hdwhdw 36c5498
replace holder for gnoi os server implementation.
hdwhdw b96d1e5
add counters.
hdwhdw cc6c8d8
implementation of dbus client.
hdwhdw 74ddcbe
improvement of logs.
hdwhdw 3465fdf
server implementation for verify.
hdwhdw 18ed5a4
add component test for os_verify.
hdwhdw 02ea8b2
fix test/utils.py
hdwhdw 53a1313
Fix typo.
hdwhdw ff7fa0f
rename import alias
hdwhdw 8e26df5
fix memleak failure. implementation should tolerate empty output from…
hdwhdw b7b9e11
address comment.
hdwhdw 55b170c
remove defer dbus.close since the service is not implemented.
hdwhdw f6b81cf
fix unit tests.
hdwhdw e951e34
more unit test coverage.
hdwhdw 1b48f45
add more unit test.
hdwhdw 5ada512
more unit test.
hdwhdw 82bf840
remove an obsolete line.
hdwhdw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package os | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"encoding/json" | ||
pb "github.com/openconfig/gnoi/os" | ||
"github.com/sonic-net/sonic-gnmi/gnoi_client/utils" | ||
"google.golang.org/grpc" | ||
) | ||
|
||
func Verify(conn *grpc.ClientConn, ctx context.Context) { | ||
fmt.Println("OS Verify") | ||
ctx = utils.SetUserCreds(ctx) | ||
osc := pb.NewOSClient(conn) | ||
resp, err := osc.Verify(ctx, new(pb.VerifyRequest)) | ||
if err != nil { | ||
panic(err.Error()) | ||
} | ||
respstr, err := json.Marshal(resp) | ||
if err != nil { | ||
panic(err.Error()) | ||
} | ||
fmt.Println(string(respstr)) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Ensure DbusClient be closed or released to avoid resource leaks. Use
defer
to clean up.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.
Done and I'll put forward a PR to complete this for everything here.
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.
Actually I take this back. The Close() method does not exist and that's why I don't see this statement in any other methods. Let me address this with another PR but for now let's just follow the surrounding code.