From 79eb02e8a64ad87f0a91fc37d93a5a665054be2e Mon Sep 17 00:00:00 2001 From: Robert Bays Date: Sun, 30 May 2010 22:35:04 -0700 Subject: fix second part of bug 5593 --- .../bgp/node.tag/neighbor/node.tag/distribute-list/export/node.def | 6 ++++++ .../bgp/node.tag/neighbor/node.tag/distribute-list/import/node.def | 6 ++++++ .../bgp/node.tag/neighbor/node.tag/filter-list/export/node.def | 6 ++++++ .../bgp/node.tag/neighbor/node.tag/filter-list/import/node.def | 6 ++++++ .../protocols/bgp/node.tag/neighbor/node.tag/peer-group/node.def | 7 ------- .../bgp/node.tag/neighbor/node.tag/prefix-list/export/node.def | 6 ++++++ .../bgp/node.tag/neighbor/node.tag/prefix-list/import/node.def | 6 ++++++ .../bgp/node.tag/neighbor/node.tag/route-map/export/node.def | 6 ++++++ .../bgp/node.tag/neighbor/node.tag/route-map/import/node.def | 6 ++++++ 9 files changed, 48 insertions(+), 7 deletions(-) diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/export/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/export/node.def index 35c78cb3..2e54a619 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/export/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/export/node.def @@ -10,6 +10,12 @@ update: if [ -n "$VAR(../../remote-as/@)" ]; then else peer="peer-group $VAR(../../peer-group/@)"; fi; + if /opt/vyatta/sbin/vyatta-bgp.pl --check-if-peer-group \ + --peergroup $VAR(../../@); then + vyatta-vtysh --noerr -c "configure terminal" \ + -c "router bgp $VAR(../../../@)" \ + -c "neighbor $VAR(../../@) peer-group"; + fi; vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(../../../@)" \ -c "neighbor $VAR(../../@) $peer" \ -c "neighbor $VAR(../../@) distribute-list $VAR(@) out" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/import/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/import/node.def index 378ea604..f703f183 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/import/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/distribute-list/import/node.def @@ -10,6 +10,12 @@ update: if [ -n "$VAR(../../remote-as/@)" ]; then else peer="peer-group $VAR(../../peer-group/@)"; fi; + if /opt/vyatta/sbin/vyatta-bgp.pl --check-if-peer-group \ + --peergroup $VAR(../../@); then + vyatta-vtysh --noerr -c "configure terminal" \ + -c "router bgp $VAR(../../../@)" \ + -c "neighbor $VAR(../../@) peer-group"; + fi; vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(../../../@)" \ -c "neighbor $VAR(../../@) $peer" \ -c "neighbor $VAR(../../@) distribute-list $VAR(@) in" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/export/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/export/node.def index 48e397db..bed2373e 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/export/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/export/node.def @@ -19,6 +19,12 @@ update: if [ -n "$VAR(../../remote-as/@)" ]; then else peer="peer-group $VAR(../../peer-group/@)"; fi; + if /opt/vyatta/sbin/vyatta-bgp.pl --check-if-peer-group \ + --peergroup $VAR(../../@); then + vyatta-vtysh --noerr -c "configure terminal" \ + -c "router bgp $VAR(../../../@)" \ + -c "neighbor $VAR(../../@) peer-group"; + fi; if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../../@); then vyatta-vtysh -c "configure terminal" \ -c "router bgp $VAR(../../../@)" \ diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/import/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/import/node.def index 91b8814c..0038a70e 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/import/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/import/node.def @@ -19,6 +19,12 @@ update: if [ -n "$VAR(../../remote-as/@)" ]; then else peer="peer-group $VAR(../../peer-group/@)"; fi; + if /opt/vyatta/sbin/vyatta-bgp.pl --check-if-peer-group \ + --peergroup $VAR(../../@); then + vyatta-vtysh --noerr -c "configure terminal" \ + -c "router bgp $VAR(../../../@)" \ + -c "neighbor $VAR(../../@) peer-group"; + fi; if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../../@); then vyatta-vtysh -c "configure terminal" \ -c "router bgp $VAR(../../../@)" \ diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/peer-group/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/peer-group/node.def index 9d2cc549..26f54db7 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/peer-group/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/peer-group/node.def @@ -1,19 +1,12 @@ type: txt - help: Set to add this neighbor to a peer-group - comp_help: \1 \tpeer-group name - syntax:expression: exec "if [ -n \"`echo $VAR(../@) | sed 's/[0-9]\\{1,3\\}.[0-9]\\{1,3\\}.[0-9]\\{1,3\\}.[0-9]\\{1,3\\}//'`\" ]; then \ exit 1; \ fi; "; "peer-group token may not be specified for a peer-group" - commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --check-as --peergroup=$VAR(@) --as $VAR(../../@) --neighbor $VAR(../@)" - commit:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"protocols bgp $VAR(../../@) neighbor $VAR(@)\" "; "protocols bgp $VAR(../../@) neighbor $VAR(../@) peer-group: peer-group $VAR(@) doesn't exist" - update: vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(../../@)" \ -c "neighbor $VAR(../@) peer-group $VAR(@)" - delete: vyatta-vtysh --noerror -c "configure terminal" -c "router bgp $VAR(../../@)" \ -c "no neighbor $VAR(../@) peer-group $VAR(@)" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/export/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/export/node.def index eb8c252c..4dc5098e 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/export/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/export/node.def @@ -23,6 +23,12 @@ update: if [ -n "$VAR(../../remote-as/@)" ]; then else peer="peer-group $VAR(../../peer-group/@)"; fi; + if /opt/vyatta/sbin/vyatta-bgp.pl --check-if-peer-group \ + --peergroup $VAR(../../@); then + vyatta-vtysh --noerr -c "configure terminal" \ + -c "router bgp $VAR(../../../@)" \ + -c "neighbor $VAR(../../@) peer-group"; + fi; if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../../@); then vyatta-vtysh -c "configure terminal" \ -c "router bgp $VAR(../../../@)" \ diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/import/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/import/node.def index 849a871d..60ab2ccb 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/import/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/prefix-list/import/node.def @@ -23,6 +23,12 @@ update: if [ -n "$VAR(../../remote-as/@)" ]; then else peer="peer-group $VAR(../../peer-group/@)"; fi; + if /opt/vyatta/sbin/vyatta-bgp.pl --check-if-peer-group \ + --peergroup $VAR(../../@); then + vyatta-vtysh --noerr -c "configure terminal" \ + -c "router bgp $VAR(../../../@)" \ + -c "neighbor $VAR(../../@) peer-group"; + fi; if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../../@); then vyatta-vtysh -c "configure terminal" \ -c "router bgp $VAR(../../../@)" \ diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/export/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/export/node.def index 47e78336..a8b20609 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/export/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/export/node.def @@ -12,6 +12,12 @@ update: if [ -n "$VAR(../../remote-as/@)" ]; then else peer="peer-group $VAR(../../peer-group/@)"; fi; + if /opt/vyatta/sbin/vyatta-bgp.pl --check-if-peer-group \ + --peergroup $VAR(../../@); then + vyatta-vtysh --noerr -c "configure terminal" \ + -c "router bgp $VAR(../../../@)" \ + -c "neighbor $VAR(../../@) peer-group"; + fi; if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../../@) then vyatta-vtysh -c "configure terminal" \ diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/import/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/import/node.def index 4bac3854..7723bf77 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/import/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/import/node.def @@ -12,6 +12,12 @@ update: if [ -n "$VAR(../../remote-as/@)" ]; then else peer="peer-group $VAR(../../peer-group/@)"; fi; + if /opt/vyatta/sbin/vyatta-bgp.pl --check-if-peer-group \ + --peergroup $VAR(../../@); then + vyatta-vtysh --noerr -c "configure terminal" \ + -c "router bgp $VAR(../../../@)" \ + -c "neighbor $VAR(../../@) peer-group"; + fi; if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../../@) then vyatta-vtysh -c "configure terminal" \ -- cgit v1.2.3