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

more verbose logging

parent 8fcb44a2
No related branches found
No related tags found
2 merge requests!221Thesis mk,!173Process response overhaul
Pipeline #74833 passed with warnings
......@@ -142,7 +142,9 @@ func shutdown() error {
func callback(id uuid.UUID, ch chan nucleus.DeviceDetails) {
if ch != nil {
c.pndc.AddPendingChannel(id, ch)
log.Infof("pending channel %v added", id)
} else {
c.pndc.RemovePendingChannel(id)
log.Infof("pending channel %v removed", id)
}
}
......@@ -2,6 +2,7 @@ package server
import (
"context"
log "github.com/sirupsen/logrus"
"time"
cpb "code.fbi.h-da.de/cocsn/api/go/gosdn/csbi"
......@@ -17,13 +18,15 @@ type csbi struct {
func (s csbi) Hello(ctx context.Context, syn *cpb.Syn) (*cpb.Ack, error) {
ch, err := pndc.PendingChannels(nucleus.FromString(syn.Id))
if err != nil {
return nil, status.Errorf(codes.Aborted, "%v", err)
log.Error(err)
return nil, status.Errorf(codes.Aborted, "pending channel %v", err)
}
ch <- nucleus.DeviceDetails{
ID: syn.Id,
Address: syn.Address,
}
details := <- ch
log.Infof("ack to csbi %v", syn.Id)
return &cpb.Ack{
Timestamp: time.Now().UnixNano(),
TransportOption: details.TransportOption,
......
......@@ -434,6 +434,7 @@ func (pnd *pndImplementation) createCsbiDevice(name string, d *cpb.Deployment, o
pnd.callback(id, ch)
go func() {
deviceDetails := <-ch
log.Infof("syn from csbi %v", deviceDetails.ID)
id, err := uuid.Parse(deviceDetails.ID)
if err != nil {
panic(err)
......
......@@ -177,10 +177,7 @@ func (csbi *Csbi) SbiIdentifier() string {
func (csbi *Csbi) SetNode() func(schema *yang.Entry, root interface{}, path *gpb.Path, val interface{}, opts ...ytypes.SetNodeOpt) error {
return func(schema *yang.Entry, root interface{}, path *gpb.Path, val interface{}, opts ...ytypes.SetNodeOpt) error {
if err := ytypes.SetNode(schema, root.(*Device), path, val, opts...); err != nil {
return err
}
return nil
return &errors.ErrNotYetImplemented{}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment