Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
goSDN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
goSDN
Commits
e2191b2e
Commit
e2191b2e
authored
4 years ago
by
Manuel Kieweg
Browse files
Options
Downloads
Patches
Plain Diff
fill did list
parent
b04a5483
No related branches found
No related tags found
1 merge request
!184
Change go module paths
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
northbound/server/pnd.go
+4
-1
4 additions, 1 deletion
northbound/server/pnd.go
northbound/server/pnd_test.go
+4
-0
4 additions, 0 deletions
northbound/server/pnd_test.go
with
8 additions
and
1 deletion
northbound/server/pnd.go
+
4
−
1
View file @
e2191b2e
...
@@ -211,11 +211,14 @@ func fillOnds(pnd networkdomain.NetworkDomain, all bool, did ...string) ([]*ppb.
...
@@ -211,11 +211,14 @@ func fillOnds(pnd networkdomain.NetworkDomain, all bool, did ...string) ([]*ppb.
var
ondList
[]
uuid
.
UUID
var
ondList
[]
uuid
.
UUID
var
onds
[]
*
ppb
.
OrchestratedNetworkingDevice
var
onds
[]
*
ppb
.
OrchestratedNetworkingDevice
// all
decid
es if a client wants all devices or only a single one
// all
indicat
es if a client wants all devices or only a single one
switch
all
{
switch
all
{
case
true
:
case
true
:
ondList
=
pnd
.
Devices
()
ondList
=
pnd
.
Devices
()
onds
=
make
([]
*
ppb
.
OrchestratedNetworkingDevice
,
len
(
ondList
))
onds
=
make
([]
*
ppb
.
OrchestratedNetworkingDevice
,
len
(
ondList
))
for
_
,
id
:=
range
ondList
{
did
=
append
(
did
,
id
.
String
())
}
default
:
default
:
if
len
(
did
)
==
0
{
if
len
(
did
)
==
0
{
err
:=
&
errors
.
ErrInvalidParameters
{
err
:=
&
errors
.
ErrInvalidParameters
{
...
...
This diff is collapsed.
Click to expand it.
northbound/server/pnd_test.go
+
4
−
0
View file @
e2191b2e
...
@@ -139,6 +139,10 @@ func Test_pnd_Get(t *testing.T) {
...
@@ -139,6 +139,10 @@ func Test_pnd_Get(t *testing.T) {
p
:=
pndServer
{
p
:=
pndServer
{
UnimplementedPndServer
:
ppb
.
UnimplementedPndServer
{},
UnimplementedPndServer
:
ppb
.
UnimplementedPndServer
{},
}
}
if
err
:=
pndc
.
Add
(
mockDevice
);
err
!=
nil
{
t
.
Error
(
err
)
return
}
resp
,
err
:=
p
.
Get
(
tt
.
args
.
ctx
,
tt
.
args
.
request
)
resp
,
err
:=
p
.
Get
(
tt
.
args
.
ctx
,
tt
.
args
.
request
)
if
(
err
!=
nil
)
!=
tt
.
wantErr
{
if
(
err
!=
nil
)
!=
tt
.
wantErr
{
t
.
Errorf
(
"Get() error = %v, wantErr %v"
,
err
,
tt
.
wantErr
)
t
.
Errorf
(
"Get() error = %v, wantErr %v"
,
err
,
tt
.
wantErr
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment