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
574da4a4
Commit
574da4a4
authored
2 years ago
by
André Sterba
Browse files
Options
Downloads
Patches
Plain Diff
Fix processing delete response
parent
3df2d72c
No related branches found
No related tags found
1 merge request
!342
Resolve "Add an option to send gNMI Subscribe requests via SBI"
Pipeline
#110117
passed
2 years ago
Stage: build
Stage: test
Stage: analyze
Stage: integration-test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controller/nucleus/gnmi_transport.go
+17
-21
17 additions, 21 deletions
controller/nucleus/gnmi_transport.go
with
17 additions
and
21 deletions
controller/nucleus/gnmi_transport.go
+
17
−
21
View file @
574da4a4
...
@@ -314,29 +314,25 @@ func handleProcessResponseErrors(errs []error) error {
...
@@ -314,29 +314,25 @@ func handleProcessResponseErrors(errs []error) error {
return
fmt
.
Errorf
(
"encountered %v errors during response processing
\n
%v"
,
len
(
errs
),
errs
)
return
fmt
.
Errorf
(
"encountered %v errors during response processing
\n
%v"
,
len
(
errs
),
errs
)
}
}
func
(
g
*
Gnmi
)
processResponseDeletes
(
deletes
[]
*
gpb
.
Path
,
root
ygot
.
ValidatedGoStruct
,
s
*
ytypes
.
Schema
)
error
{
func
(
g
*
Gnmi
)
processResponseDeletes
(
deletes
[]
*
gpb
.
Path
,
deviceModel
ygot
.
ValidatedGoStruct
,
rootSchema
*
ytypes
.
Schema
)
error
{
errs
:=
make
([]
error
,
0
)
if
err
:=
ytypes
.
DeleteNode
(
rootSchema
.
RootSchema
(),
deviceModel
,
deletes
[
0
]);
err
!=
nil
{
return
err
for
_
,
path
:=
range
deletes
{
}
if
err
:=
ytypes
.
DeleteNode
(
s
.
RootSchema
(),
root
,
path
);
err
!=
nil
{
modelAsString
,
_
:=
ygot
.
EmitJSON
(
deviceModel
,
&
ygot
.
EmitJSONConfig
{
errs
=
append
(
errs
,
err
)
Format
:
ygot
.
RFC7951
,
}
Indent
:
""
,
modelAsString
,
_
:=
ygot
.
EmitJSON
(
root
,
&
ygot
.
EmitJSONConfig
{
SkipValidation
:
true
,
Format
:
ygot
.
RFC7951
,
RFC7951Config
:
&
ygot
.
RFC7951JSONConfig
{
Indent
:
""
,
AppendModuleName
:
true
,
SkipValidation
:
true
,
}})
RFC7951Config
:
&
ygot
.
RFC7951JSONConfig
{
AppendModuleName
:
true
,
rootPath
,
err
:=
ygot
.
StringToStructuredPath
(
"/"
)
}})
if
err
!=
nil
{
if
err
:=
g
.
Unmarshal
([]
byte
(
modelAsString
),
path
,
root
);
err
!=
nil
{
return
err
errs
=
append
(
errs
,
err
)
}
log
.
Error
(
root
)
}
}
if
len
(
errs
)
!=
0
{
if
err
:=
g
.
Unmarshal
([]
byte
(
modelAsString
),
rootPath
,
deviceModel
);
err
!=
nil
{
return
handleProcessResponseErrors
(
err
s
)
return
err
}
}
return
nil
return
nil
...
...
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