diff options
author | Carl Baldwin <carl@ecbaldwin.net> | 2019-04-26 16:14:56 -0600 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-05-02 19:39:07 +0900 |
commit | cc267fad9e6410705420af220d73d25d288e8a58 (patch) | |
tree | b05dfc56c57e6d4cca98d6585f07354d83610b66 /cmd | |
parent | fd6618fed499d7abe8ecc88427d47448b538a94e (diff) |
Consolidate duplicate code blocks both updating peer groups
There were only two differences: 1) the first block updates
`updatePolicy` and 2) the log statements are a little bit different
(`pg.State` vs `pg.Config` and `%v` vs `%s`).
To be consistent with the other blocks above it, changed to use
`pg.Config` rather than `pg.State`.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gobgpd/main.go | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/cmd/gobgpd/main.go b/cmd/gobgpd/main.go index 06b38b88..546b4e47 100644 --- a/cmd/gobgpd/main.go +++ b/cmd/gobgpd/main.go @@ -391,7 +391,7 @@ func main() { } } for _, pg := range updatedPg { - log.Infof("PeerGroup %v is updated", pg.State.PeerGroupName) + log.Infof("PeerGroup %s is updated", pg.Config.PeerGroupName) if u, err := bgpServer.UpdatePeerGroup(context.Background(), &api.UpdatePeerGroupRequest{ PeerGroup: config.NewPeerGroupFromConfigStruct(&pg), }); err != nil { @@ -400,14 +400,6 @@ func main() { updatePolicy = updatePolicy || u.NeedsSoftResetIn } } - for _, pg := range updatedPg { - log.Infof("PeerGroup %s is updated", pg.Config.PeerGroupName) - if _, err := bgpServer.UpdatePeerGroup(context.Background(), &api.UpdatePeerGroupRequest{ - PeerGroup: config.NewPeerGroupFromConfigStruct(&pg), - }); err != nil { - log.Warn(err) - } - } for _, dn := range newConfig.DynamicNeighbors { log.Infof("Dynamic Neighbor %s is added to PeerGroup %s", dn.Config.Prefix, dn.Config.PeerGroup) if err := bgpServer.AddDynamicNeighbor(context.Background(), &api.AddDynamicNeighborRequest{ |