Skip to content

Commit

Permalink
cmd/gobgp: fix policy printing
Browse files Browse the repository at this point in the history
make policy printing same with v1.x

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
  • Loading branch information
fujita committed Feb 16, 2019
1 parent 483a0b6 commit aaa71b1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/gobgp/neighbor.go
Expand Up @@ -1042,7 +1042,6 @@ func stateChangeNeighbor(cmd string, remoteIP string, args []string) error {
}

func showNeighborPolicy(remoteIP, policyType string, indent int) error {
var assignment *api.PolicyAssignment
var err error
var dir api.PolicyDirection

Expand All @@ -1064,11 +1063,13 @@ func showNeighborPolicy(remoteIP, policyType string, indent int) error {
if err != nil {
return err
}
assignment := &api.PolicyAssignment{}
r, err := stream.Recv()
if err != nil {
if err == nil {
assignment = r.Assignment
} else if err != io.EOF {
return err
}
assignment = r.Assignment

if globalOpts.Json {
j, _ := json.Marshal(assignment)
Expand Down

0 comments on commit aaa71b1

Please sign in to comment.