From b5b1c71bc95bdaea24f45e5738e9a3a7f8740a4f Mon Sep 17 00:00:00 2001 From: Michael Larson Date: Mon, 30 Jun 2008 10:18:44 -0700 Subject: set load-balancing load order after interfaces are configured on load. --- scripts/VyattaConfigLoad.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/VyattaConfigLoad.pm b/scripts/VyattaConfigLoad.pm index f1339c3..936a9cf 100755 --- a/scripts/VyattaConfigLoad.pm +++ b/scripts/VyattaConfigLoad.pm @@ -49,7 +49,7 @@ my %config_rank = ( 'protocols ospf' => 780, 'protocols rip' => 770, 'vpn' => 600, - + 'load-balancing' => 500, ); my %regex_rank = ( -- cgit v1.2.3 From 7800d646eb6af2a41b82f25bd2961bfaf1dd202e Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Mon, 30 Jun 2008 15:31:24 -0700 Subject: Fix 3396: "commit failed at rank 800" while booting with bgp peer-group. --- scripts/VyattaConfigLoad.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/VyattaConfigLoad.pm b/scripts/VyattaConfigLoad.pm index 936a9cf..0e0c658 100755 --- a/scripts/VyattaConfigLoad.pm +++ b/scripts/VyattaConfigLoad.pm @@ -56,7 +56,8 @@ my %regex_rank = ( 'interfaces ethernet \S* vrrp' => 500, 'interfaces ethernet \S* vif \S* vrrp' => 500, 'protocols bgp \d+ parameters' => 810, - 'protocols bgp \d+ neighbor \S*[^\d.]\S*' => 800, + 'protocols bgp \d+ neighbor \d+\.\d+\.\d+\.\d+' => 800, + 'protocols bgp \d+ neighbor \w+' => 801, ); my @all_nodes = (); -- cgit v1.2.3 From 2eb529344218114f29d34e60f8485d18e49508ce Mon Sep 17 00:00:00 2001 From: Michael Larson Date: Mon, 30 Jun 2008 17:11:10 -0700 Subject: Revert "set load-balancing load order after interfaces are configured on load." This reverts commit b5b1c71bc95bdaea24f45e5738e9a3a7f8740a4f. --- scripts/VyattaConfigLoad.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/VyattaConfigLoad.pm b/scripts/VyattaConfigLoad.pm index 936a9cf..f1339c3 100755 --- a/scripts/VyattaConfigLoad.pm +++ b/scripts/VyattaConfigLoad.pm @@ -49,7 +49,7 @@ my %config_rank = ( 'protocols ospf' => 780, 'protocols rip' => 770, 'vpn' => 600, - 'load-balancing' => 500, + ); my %regex_rank = ( -- cgit v1.2.3 From 23c2cf67eda71cd15a94f1a28a9e699ea45cbc3e Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Tue, 1 Jul 2008 17:12:07 -0700 Subject: Partial fix for 3383: check for vyatta-config-version, warn/prompt that it appears to be invalid config. --- scripts/vyatta-load-config.pl | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl index 29d4dec..ee4a9c4 100755 --- a/scripts/vyatta-load-config.pl +++ b/scripts/vyatta-load-config.pl @@ -23,6 +23,9 @@ use strict; use lib "/opt/vyatta/share/perl5/"; +use POSIX; +use IO::Prompt; +use Sys::Syslog qw(:standard :macros); use VyattaConfigLoad; my $etcdir = $ENV{vyatta_sysconfdir}; @@ -42,6 +45,7 @@ my $proto; if (defined($ARGV[0])) { $load_file = $ARGV[0]; } +my $orig_load_file = $load_file; if ($load_file =~ /^[^\/]\w+:\//) { if ($load_file =~ /^(\w+):\/\/\w/) { @@ -107,20 +111,36 @@ if ($mode eq 'local') { } $load_file = $url_tmp_file; } + +my $xorp_cfg = 0; +my $valid_cfg = 0; while () { if (/\/\*XORP Configuration File, v1.0\*\//) { - print "Warning: Loading a pre-Glendale configuration.\n"; - print "Do you want to continue? [no] "; - my $resp = ; - if (!($resp =~ /^yes$/i)) { - print "Configuration not loaded\n"; - exit 1; - } + $xorp_cfg = 1; + last; + } elsif (/vyatta-config-version/) { + $valid_cfg = 1; last; } } +if ($xorp_cfg or ! $valid_cfg) { + if ($xorp_cfg) { + print "Warning: Loading a pre-Glendale configuration.\n"; + } else { + print "Warning: file does NOT appear to be a valid config file.\n"; + } + if (!prompt("Do you want to continue? ", -tty, -Yes, -default=>'no')) { + print "Configuration not loaded\n"; + exit 1; + } +} close CFG; +# log it +openlog($0, "", LOG_USER); +my $login = getlogin() || getpwuid($<) || "unknown"; +syslog("warning", "Load config [$orig_load_file] by $login"); + # do config migration system("$sbindir/vyatta_config_migrate.pl $load_file"); -- cgit v1.2.3 From 9178dcb68c092976f9bed29c13dbd70cb26de3a1 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Mon, 7 Jul 2008 14:35:36 -0700 Subject: fix for bug 3323: skip deletions of nodes with default values when loading a config file. --- scripts/VyattaConfigLoad.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/VyattaConfigLoad.pm b/scripts/VyattaConfigLoad.pm index 6f8a451..1a7f26e 100755 --- a/scripts/VyattaConfigLoad.pm +++ b/scripts/VyattaConfigLoad.pm @@ -397,8 +397,19 @@ sub getConfigDiff { # everything together anyway. @delete_list = sort { ${$a}[1] <=> ${$b}[1] } @delete_list; @set_list = sort { ${$b}[1] <=> ${$a}[1] } @set_list; + + # need to filter out deletions of nodes with default values + my @new_delete_list = (); + foreach my $del (@delete_list) { + my @comps = map { s/^'(.*)'$/$1/; $_; } @{${$del}[0]}; + my ($is_multi, $is_text, $default) = $active_cfg->parseTmpl(\@comps); + if (!defined($default)) { + push @new_delete_list, $del; + } + } + my %diff = ( - 'delete' => \@delete_list, + 'delete' => \@new_delete_list, 'set' => \@set_list, ); return %diff; -- cgit v1.2.3 From 42d6c942800e2273b77ea92371ffdcb3f183163f Mon Sep 17 00:00:00 2001 From: root Date: Wed, 9 Jul 2008 11:50:17 -0700 Subject: fix for bug 3441. Removed def from listOutputNodes(), which allowed other code that filters out def file to be removed. --- scripts/VyattaConfig.pm | 4 +++- scripts/VyattaConfigLoad.pm | 3 --- scripts/VyattaConfigOutput.pm | 6 ++---- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/VyattaConfig.pm b/scripts/VyattaConfig.pm index 3c4b51f..1c0eaf3 100755 --- a/scripts/VyattaConfig.pm +++ b/scripts/VyattaConfig.pm @@ -130,7 +130,9 @@ sub listOrigNodes { $tmp =~ s/\n//g; $tmp =~ s/%2F/\//g; #print "DEBUG VyattaConfig->listNodes(): node = $tmp\n"; - push @nodes_modified, $tmp; + if ($tmp ne 'def') { + push @nodes_modified, $tmp; + } } return @nodes_modified; diff --git a/scripts/VyattaConfigLoad.pm b/scripts/VyattaConfigLoad.pm index 1a7f26e..c8563bb 100755 --- a/scripts/VyattaConfigLoad.pm +++ b/scripts/VyattaConfigLoad.pm @@ -297,9 +297,6 @@ sub findDeletedNodes { $active_cfg->setLevel(join ' ', @active_path); my @active_nodes = $active_cfg->listOrigNodes(); foreach (@active_nodes) { - if ($_ eq 'def') { - next; - } if ($_ eq 'node.val') { findDeletedValues($new_ref, \@active_path); next; diff --git a/scripts/VyattaConfigOutput.pm b/scripts/VyattaConfigOutput.pm index 5358c21..ab7068f 100755 --- a/scripts/VyattaConfigOutput.pm +++ b/scripts/VyattaConfigOutput.pm @@ -138,7 +138,7 @@ sub displayValues { my @cnames = sort keys %cnodes; if (defined($simple_show)) { - if (!$cnodes{'def'} || $show_all) { + if ($show_all) { if ($is_password && $hide_password) { $oval = $HIDE_PASSWORD; } @@ -159,7 +159,7 @@ sub displayValues { $diff = '>'; } } - if (!$cnodes{'def'} || $show_all) { + if ($show_all) { if ($is_password && $hide_password) { $value = $HIDE_PASSWORD; } @@ -194,8 +194,6 @@ sub displayDeletedOrigChildren { if ($cnames[0] eq 'node.val') { displayValues([ @cur_path, $child ], $prefix, $child, $dont_show_as_deleted); - } elsif ($cnames[0] eq 'def') { - #ignore } elsif (scalar($#cnames) >= 0) { if ($is_tag) { @cnames = sort versioncmp @cnames; -- cgit v1.2.3