diff --git a/controller.go b/controller.go index 70c3b96ef4e023d8cdbbdf1740e9f872e7f10272..aa798f3c0e2fe384aaab716896d18725fdc89574 100644 --- a/controller.go +++ b/controller.go @@ -7,7 +7,7 @@ import ( "os" "os/signal" "sync" - "time" + "syscall" "github.com/google/uuid" log "github.com/sirupsen/logrus" @@ -52,7 +52,7 @@ func init() { } // Setting up signal capturing - signal.Notify(c.stopChan, os.Interrupt) + signal.Notify(c.stopChan, os.Interrupt, syscall.SIGTERM) } // initialize does start-up housekeeping like reading controller config files @@ -127,8 +127,6 @@ func Run(ctx context.Context) error { return shutdown() case <-ctx.Done(): return shutdown() - case <-time.Tick(time.Minute): - log.Debug("up and running") } } } diff --git a/nucleus/device.go b/nucleus/device.go index a324d1813d055a1528df13c28b88585d53735183..2194c7e1a2e11942993ae8ec12fdbfcc70335087 100644 --- a/nucleus/device.go +++ b/nucleus/device.go @@ -1,8 +1,6 @@ package nucleus import ( - "code.fbi.h-da.de/cocsn/gosdn/nucleus/errors" - tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport" "code.fbi.h-da.de/cocsn/gosdn/interfaces/device" "code.fbi.h-da.de/cocsn/gosdn/interfaces/southbound" @@ -134,5 +132,5 @@ func (d *CsbiDevice) SBI() southbound.SouthboundInterface { } func (d *CsbiDevice) ProcessResponse(resp proto.Message) error { - return &errors.ErrNotYetImplemented{} + return d.transport.ProcessResponse(resp, d.GoStruct, d.sbi.Schema()) } diff --git a/nucleus/southbound.go b/nucleus/southbound.go index b461814a7ee7b179897eb95fd973f3758957a8e8..dc074235f843ec4fe646797713bd338ce9815165 100644 --- a/nucleus/southbound.go +++ b/nucleus/southbound.go @@ -166,7 +166,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 { - return &errors.ErrNotYetImplemented{} + return ytypes.SetNode(schema, root.(*openconfig.Device), path, val, opts...) } } diff --git a/nucleus/store.go b/nucleus/store.go index 38307c5187457f28a490161ded2b0ac7449f1556..ea137638a7e59bbd0f335371cd290bf45d56372d 100644 --- a/nucleus/store.go +++ b/nucleus/store.go @@ -222,7 +222,7 @@ func (s DeviceStore) GetDevice(id uuid.UUID, parseErrors ...error) (device.Devic } log.WithFields(log.Fields{ "uuid": id, - "name": d.Name, + "name": d.Name(), }).Debug("device was accessed") return d, nil