diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-06-30 11:27:49 +0900 |
---|---|---|
committer | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-07-01 14:26:35 +0900 |
commit | 2e0ba39ce9b5d393fe64fa20d98598b8bb454d59 (patch) | |
tree | 9aadfa891a7b7b0de2026a6ac42c488ad98c0185 /server/server.go | |
parent | ae8862599082f6bd70423df255db6f4769cad5a1 (diff) |
scenario_test: add test case for distribute policy update
Diffstat (limited to 'server/server.go')
-rw-r--r-- | server/server.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/server.go b/server/server.go index 9c60f0ce..e6f41c47 100644 --- a/server/server.go +++ b/server/server.go @@ -1035,19 +1035,19 @@ func (server *BgpServer) handleGrpc(grpcReq *GrpcRequest) []*SenderMsg { pdList := server.routingPolicy.PolicyDefinitionList df := server.routingPolicy.DefinedSets - extract := func(policies []string) []*api.PolicyDefinition { + extract := func(policyNames []string) []*api.PolicyDefinition { extracted := []*api.PolicyDefinition{} - for _, conInPolicyName := range policies { + for _, policyName := range policyNames { match := false for _, pd := range pdList { - if conInPolicyName == pd.Name { + if policyName == pd.Name { match = true extracted = append(extracted, policy.PolicyDefinitionToApiStruct(pd, df)) break } } if !match { - extracted = append(extracted, &api.PolicyDefinition{PolicyDefinitionName: conInPolicyName}) + extracted = append(extracted, &api.PolicyDefinition{PolicyDefinitionName: policyName}) } } return extracted |