diff --git a/nucleus/controller.go b/nucleus/controller.go index d4bd7cb508af685fbf32bd14d59b9e8ea0bbe9ff..e503fb60e5f8fa45f60b5d557b7c84a7af530f71 100644 --- a/nucleus/controller.go +++ b/nucleus/controller.go @@ -57,7 +57,7 @@ func (c *Core) AttachDatabase() { // CreateSouthboundInterfaces initializes the controller with its supported SBIs func (c *Core) CreateSouthboundInterfaces() error { - if err := c.sbic.add(&Arista{id: uuid.New()}); err != nil { + if err := c.sbic.add(&OpenConfig{id: uuid.New()}); err != nil { return err } if err := c.sbic.add(&OpenConfig{id: uuid.New()}); err != nil { diff --git a/nucleus/southbound.go b/nucleus/southbound.go index ab2ab15d4e2ce50615a941e19835d681b5be738b..88a6ed5f7353a719f51600862183830d1a5ef54e 100644 --- a/nucleus/southbound.go +++ b/nucleus/southbound.go @@ -1,7 +1,6 @@ package nucleus import ( - "code.fbi.h-da.de/cocsn/yang-models/generated/arista" "code.fbi.h-da.de/cocsn/yang-models/generated/openconfig" "github.com/google/uuid" gpb "github.com/openconfig/gnmi/proto/gnmi" @@ -152,57 +151,3 @@ func iter(a ygot.GoStruct, fields []string) (b ygot.GoStruct, f string, err erro func (oc *OpenConfig) Id() uuid.UUID { return oc.id } - -// deprecated -// Use for prototyping only. -// Use OpenConfig instead -type Arista struct { - // deprecated - transport Transport - - schema *ytypes.Schema - id uuid.UUID -} - -func (oc *Arista) Id() uuid.UUID { - return oc.id -} - -func (oc *Arista) SbiIdentifier() string { - return "arista" -} - -func (oc *Arista) Schema() *ytypes.Schema { - schema, err := arista.Schema() - if err != nil { - log.Fatal(err) - } - oc.schema = schema - return schema -} - -// SetNode injects Arista specific model -// representation to the transport. -// Needed for type assertion. -func (oc *Arista) 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.(*arista.Device), path, val, opts...); err != nil { - return err - } - return nil - } -} - -// Unmarshal injects Arista specific model -// representation to the transport. -// Needed for type assertion. -func (oc *Arista) Unmarshal() func([]byte, interface{}, ...ytypes.UnmarshalOpt) error { - return func(bytes []byte, goStruct interface{}, opt ...ytypes.UnmarshalOpt) error { - ifaces := &arista.OpenconfigInterfaces_Interfaces{} - if err := oc.schema.Unmarshal(bytes, ifaces, opt...); err != nil { - return err - } - goStruct.(*arista.Device).Interfaces = ifaces - return nil - } -}