Skip to content
Snippets Groups Projects
Commit 40075ecc authored by Fabian Seidl's avatar Fabian Seidl
Browse files

updated descriptions, removed commented code from PND constructor

parent 5fcc7f17
No related branches found
No related tags found
1 merge request!416Resolve "Refactor how PNDs are implemented in the code"
Pipeline #138248 passed
...@@ -250,8 +250,6 @@ func createPrincipalNetworkDomain() error { ...@@ -250,8 +250,6 @@ func createPrincipalNetworkDomain() error {
config.BasePndUUID, config.BasePndUUID,
"base", "base",
"gosdn base pnd", "gosdn base pnd",
//c.csbiClient,
//callback,
) )
err = c.pndStore.Add(pnd) err = c.pndStore.Add(pnd)
if err != nil { if err != nil {
......
...@@ -95,7 +95,7 @@ func (s CoreServer) CreatePndList(ctx context.Context, request *pb.CreatePndList ...@@ -95,7 +95,7 @@ func (s CoreServer) CreatePndList(ctx context.Context, request *pb.CreatePndList
start := metrics.StartHook(labels, grpcRequestsTotal) start := metrics.StartHook(labels, grpcRequestsTotal)
defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds)
for _, r := range request.Pnd { for _, r := range request.Pnd {
pnd := nucleus.NewPND(uuid.New(), r.Name, r.Description) //, s.csbiClient, s.pndCallbackFn) pnd := nucleus.NewPND(uuid.New(), r.Name, r.Description)
if err := s.pndService.Add(pnd); err != nil { if err := s.pndService.Add(pnd); err != nil {
return nil, handleRPCError(labels, err) return nil, handleRPCError(labels, err)
......
...@@ -606,7 +606,7 @@ func stringArrayToUUIDs(sid []string) ([]uuid.UUID, error) { ...@@ -606,7 +606,7 @@ func stringArrayToUUIDs(sid []string) ([]uuid.UUID, error) {
return UUIDs, nil return UUIDs, nil
} }
// SetMneList updates the list of mnes. // SetMneList adds the list of mnes.
func (n *NetworkElementServer) SetMneList(ctx context.Context, request *mnepb.SetMneListRequest) (*mnepb.SetMneListResponse, error) { func (n *NetworkElementServer) SetMneList(ctx context.Context, request *mnepb.SetMneListRequest) (*mnepb.SetMneListResponse, error) {
labels := prometheus.Labels{"service": "mne", "rpc": "set"} labels := prometheus.Labels{"service": "mne", "rpc": "set"}
start := metrics.StartHook(labels, grpcRequestsTotal) start := metrics.StartHook(labels, grpcRequestsTotal)
......
...@@ -62,8 +62,6 @@ func (t *FilesystemPndStore) readAllPndsFromFile() ([]networkdomain.LoadedPnd, e ...@@ -62,8 +62,6 @@ func (t *FilesystemPndStore) readAllPndsFromFile() ([]networkdomain.LoadedPnd, e
uuid.MustParse(loadedPND.ID), uuid.MustParse(loadedPND.ID),
loadedPND.Name, loadedPND.Name,
loadedPND.Description, loadedPND.Description,
//csbiClient,
//t.callback,
) )
if err != nil { if err != nil {
return nil, err return nil, err
......
...@@ -15,7 +15,7 @@ func TestAddPnd(t *testing.T) { ...@@ -15,7 +15,7 @@ func TestAddPnd(t *testing.T) {
pndStore := NewPndStore(pluginServiceMock) pndStore := NewPndStore(pluginServiceMock)
pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pnd := NewPND(pndID, "testpnd", "test") //, pndID, nil, nil) pnd := NewPND(pndID, "testpnd", "test")
err := pndStore.Add(pnd) err := pndStore.Add(pnd)
...@@ -31,8 +31,8 @@ func TestGetAllPnds(t *testing.T) { ...@@ -31,8 +31,8 @@ func TestGetAllPnds(t *testing.T) {
pndStore := NewPndStore(pluginServiceMock) pndStore := NewPndStore(pluginServiceMock)
pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab") pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab")
pnd1 := NewPND(pndID1, "testpnd", "test") //, pndID1, nil, nil) pnd1 := NewPND(pndID1, "testpnd", "test")
pnd2 := NewPND(pndID2, "testpnd2", "test") //, pndID2, nil, nil) pnd2 := NewPND(pndID2, "testpnd2", "test")
inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2} inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2}
...@@ -68,8 +68,8 @@ func TestGetPnd(t *testing.T) { ...@@ -68,8 +68,8 @@ func TestGetPnd(t *testing.T) {
pndStore := NewPndStore(pluginServiceMock) pndStore := NewPndStore(pluginServiceMock)
pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab") pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab")
pnd1 := NewPND(pndID1, "testpnd", "test") //, pndID1, nil, nil) pnd1 := NewPND(pndID1, "testpnd", "test")
pnd2 := NewPND(pndID2, "testpnd2", "test") //, pndID2, nil, nil) pnd2 := NewPND(pndID2, "testpnd2", "test")
inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2} inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2}
...@@ -103,8 +103,8 @@ func TestDeletePnd(t *testing.T) { ...@@ -103,8 +103,8 @@ func TestDeletePnd(t *testing.T) {
pndStore := NewPndStore(pluginServiceMock) pndStore := NewPndStore(pluginServiceMock)
pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab") pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab")
pnd1 := NewPND(pndID1, "testpnd", "test") //, pndID1, nil, nil) pnd1 := NewPND(pndID1, "testpnd", "test")
pnd2 := NewPND(pndID2, "testpnd2", "test") //, pndID2, nil, nil) pnd2 := NewPND(pndID2, "testpnd2", "test")
inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2} inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2}
......
...@@ -9,26 +9,6 @@ import ( ...@@ -9,26 +9,6 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
// // NewPND creates a Principle Network Domain.
// func NewPND(
// name string,
// description string,
// id uuid.UUID,
// c cpb.CsbiServiceClient,
// callback func(uuid.UUID, chan networkelement.Details),
// ) (networkdomain.NetworkDomain, error) {
// pnd := &pndImplementation{
// Name: name,
// Description: description,
// Id: id,
// csbiClient: c,
// callback: callback,
// }
// return pnd, nil
// }
// NewPNDEntity creates a PND object as it is stored in the storage. // NewPNDEntity creates a PND object as it is stored in the storage.
func NewPND(pndID uuid.UUID, name string, description string) networkdomain.NetworkDomain { func NewPND(pndID uuid.UUID, name string, description string) networkdomain.NetworkDomain {
pnd := &pndImplementation{ pnd := &pndImplementation{
......
...@@ -24,7 +24,7 @@ type Service interface { ...@@ -24,7 +24,7 @@ type Service interface {
GetAll() ([]links.Link, error) GetAll() ([]links.Link, error)
} }
// TopoService is a TopoService for ports. // TopoService manages the links between nodes and their related ports.
type TopoService struct { type TopoService struct {
store Store store Store
nodeService nodes.Service nodeService nodes.Service
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment