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

removed arista SBI related code

parent f21a55d7
Branches
Tags
2 merge requests!114WIP: Complete testing,!90Develop
Pipeline #66699 canceled
......@@ -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 {
......
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
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment