From 5dfc3e0b23ffad68eac53193d28c6a732a819ee7 Mon Sep 17 00:00:00 2001
From: Manuel Kieweg <manuel.kieweg@h-da.de>
Date: Mon, 21 Jun 2021 12:24:22 +0100
Subject: [PATCH] request works w/oc

---
 controller.go         | 6 ++----
 nucleus/device.go     | 4 +---
 nucleus/southbound.go | 2 +-
 nucleus/store.go      | 2 +-
 4 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/controller.go b/controller.go
index 70c3b96ef..aa798f3c0 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 a324d1813..2194c7e1a 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 b461814a7..dc074235f 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 38307c518..ea137638a 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
-- 
GitLab