summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
authorPiotr Wydrych <pwydrych@akamai.com>2017-08-24 14:52:35 +0200
committerfujita <fujita@fujita-no-MacBook.local>2017-09-14 07:50:11 +0900
commite82f1ebad2214e16960d08fe2ad85cd9422a187b (patch)
tree01ed3e18ff1d06e49eea04daa55f036670b7502f /table
parentdcc1efb627b1f54926232eea231ce559a063938c (diff)
table/policy: fix ReplacePolicy with preserve=false to remove old statements
Diffstat (limited to 'table')
-rw-r--r--table/policy.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/table/policy.go b/table/policy.go
index 6d2af2d4..c870c42e 100644
--- a/table/policy.go
+++ b/table/policy.go
@@ -3484,9 +3484,10 @@ func (r *RoutingPolicy) ReplacePolicy(x *Policy, refer, preserve bool) (err erro
}
}
+ ys := y.Statements
err = y.Replace(x)
if err == nil && !preserve {
- for _, st := range y.Statements {
+ for _, st := range ys {
if !r.statementInUse(st) {
log.WithFields(log.Fields{
"Topic": "Policy",