From 77813273feae5d5635d3f4da4c03066a78a11a02 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 26 Dec 2018 07:34:23 +0100 Subject: T1122: move the misplaced check to where it belonds to allow deleting "set comm-list" statements. --- .../route-map/node.tag/rule/node.tag/set/comm-list/node.def | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/node.def b/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/node.def index 9ae67bc2..2438ee51 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/node.def @@ -1,15 +1,18 @@ help: Border Gateway Protocol (BGP) communities matching a community-list delete: touch /tmp/policy-route-map-$VAR(../../../@)-$VAR(../../action/@)-$VAR(../../@)-set-comm-list.$PPID -end: if [ -z "$VAR(./comm-list/)" ]; then - echo You must configure a comm-list ; - exit 1 ; - fi ; +end: vtysh --noerror -c "configure terminal" \ -c "route-map $VAR(../../../@) $VAR(../../action/@) $VAR(../../@)" \ -c "no set comm-list " ; if [ -f "/tmp/policy-route-map-$VAR(../../../@)-$VAR(../../action/@)-$VAR(../../@)-set-comm-list.$PPID" ]; then rm -rf /tmp/policy-route-map-$VAR(../../../@)-$VAR(../../action/@)-$VAR(../../@)-set-comm-list.$PPID; else + if [ -z "$VAR(./comm-list/)" ]; then + echo You must configure a comm-list ; + exit 1 ; + fi ; + + # uncomment this when 2525 is fixed and comment out the subsequent call #if [ -n "$VAR(./delete/)" ]; then # cond="delete" ; -- cgit v1.2.3