From 7690ec0b1235e87c1fdb41cf7c0b7a6d6e4e87e0 Mon Sep 17 00:00:00 2001 From: Marek Isalski Date: Tue, 1 Oct 2019 14:55:56 +0100 Subject: [PATCH] use dicts for BGP control plane protection --- bcp38.ipset.j2 | 4 ++-- top.sls | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bcp38.ipset.j2 b/bcp38.ipset.j2 index d560346..df7dc0e 100644 --- a/bcp38.ipset.j2 +++ b/bcp38.ipset.j2 @@ -28,7 +28,7 @@ destroy tmp-bcp38-else-oface-v6 {% if salt["pillar.get"]("control-plane-protection:bgp:IPv4",None) != None %} create tmp-control-plane-bgp-v4 hash:net family inet hashsize 1024 maxelem 65536 -{% for subnet in salt["pillar.get"]("control-plane-protection:bgp:IPv4",[]) %} +{% for subnet in salt["pillar.get"]("control-plane-protection:bgp:IPv4",{}).keys() %} add tmp-control-plane-bgp-v4 {{ subnet }} {% endfor %} swap tmp-control-plane-bgp-v4 control-plane-bgp-v4 @@ -37,7 +37,7 @@ destroy tmp-control-plane-bgp-v4 {% if salt["pillar.get"]("control-plane-protection:bgp:IPv6",None) != None %} create tmp-control-plane-bgp-v6 hash:net family inet6 hashsize 1024 maxelem 65536 -{% for subnet in salt["pillar.get"]("control-plane-protection:bgp:IPv6",[]) %} +{% for subnet in salt["pillar.get"]("control-plane-protection:bgp:IPv6",{}).keys() %} add tmp-control-plane-bgp-v6 {{ subnet }} {% endfor %} swap tmp-control-plane-bgp-v6 control-plane-bgp-v6 diff --git a/top.sls b/top.sls index 0601c89..6b2f0a7 100644 --- a/top.sls +++ b/top.sls @@ -1,5 +1,5 @@ hphr: hphr: - match: nodegroup - - hphr -# - test +# - hphr + - test