Skip to content
Snippets Groups Projects
Commit 41062266 authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

Fixed authentication failed issue

parent 81620ab8
No related branches found
No related tags found
2 merge requests!91"Overhaul Architecture",!90Develop
......@@ -29,7 +29,7 @@ func main() {
transport := &nucleus.Gnmi{SetNode: sbi.SetNode()}
cfg := &gnmi.Config{
Addr: "localhost:9339",
Addr: "portainer.danet.fbi.h-da.de:6030",
Username: "admin",
Password: "arista",
Encoding: gpb.Encoding_PROTO,
......@@ -38,7 +38,7 @@ func main() {
device.Transport = transport
p := []string{"/interfaces/interface[name=en0]/state/name"}
p := []string{"/interfaces/interface[name=*]/state/name"}
errors := 0
for _, path := range p {
err := pnd.RequestAll(path)
......
......@@ -115,6 +115,7 @@ func (g *Gnmi) Capabilities(ctx context.Context) (interface{}, error) {
// Get calls GNMI get
func (g *Gnmi) get(ctx context.Context, paths [][]string, origin string) (interface{}, error) {
ctx = gnmi.NewContext(ctx, g.config)
ctx = context.WithValue(ctx, "config", g.config)
req, err := gnmi.NewGetRequest(ctx, paths, origin)
if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment