summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-07-31 15:07:36 -0700
committerslioch <slioch@eng-140.vyatta.com>2009-07-31 15:07:36 -0700
commit9c2f8965e28bd4af5f8773b85dbee0511f447ec3 (patch)
tree5b5a53f30b8e940d50a692048e69745ab856353f /scripts
parent82751643f22509c145d7dae31798913ffc4c7f41 (diff)
downloadvyatta-cfg-9c2f8965e28bd4af5f8773b85dbee0511f447ec3.tar.gz
vyatta-cfg-9c2f8965e28bd4af5f8773b85dbee0511f447ec3.zip
cleaned out more of the islavista rank code. closing bug 4473 as a result
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-config-gen-sets.pl9
-rwxr-xr-xscripts/vyatta-config-loader.pl15
2 files changed, 1 insertions, 23 deletions
diff --git a/scripts/vyatta-config-gen-sets.pl b/scripts/vyatta-config-gen-sets.pl
index 2fe4ac6..566570e 100755
--- a/scripts/vyatta-config-gen-sets.pl
+++ b/scripts/vyatta-config-gen-sets.pl
@@ -32,23 +32,14 @@ my $conf_file = '/opt/vyatta/etc/config/config.boot';
$conf_file = $ARGV[0] if defined $ARGV[0];
# get a list of all config statement in the startup config file
-# (sorted by rank).
my @all_nodes = Vyatta::ConfigLoad::getStartupConfigStatements($conf_file);
if (scalar(@all_nodes) == 0) {
# no config statements
exit 1;
}
-my $cur_rank = ${$all_nodes[0]}[1];
my $ret = 0;
-# higher-ranked statements committed before lower-ranked.
foreach (@all_nodes) {
- my ($path_ref, $rank) = @$_;
- if ($rank != $cur_rank) {
- # commit all nodes with the same rank together.
- print "commit\n";
- $cur_rank = $rank;
- }
my $cmd = "set " . (join ' ', @$path_ref);
print "$cmd\n";
}
diff --git a/scripts/vyatta-config-loader.pl b/scripts/vyatta-config-loader.pl
index a32d1fc..61eafa5 100755
--- a/scripts/vyatta-config-loader.pl
+++ b/scripts/vyatta-config-loader.pl
@@ -46,14 +46,12 @@ sub restore_fds {
}
# get a list of all config statement in the startup config file
-# (sorted by rank).
my @all_nodes = Vyatta::ConfigLoad::getStartupConfigStatements($ARGV[0]);
if (scalar(@all_nodes) == 0) {
# no config statements
restore_fds();
exit 1;
}
-my $cur_rank = ${$all_nodes[0]}[1];
# set up the config environment
my $CWRAPPER = '/opt/vyatta/sbin/vyatta-cfg-cmd-wrapper';
@@ -69,20 +67,9 @@ if ($? >> 8) {
my $commit_cmd = "$CWRAPPER commit";
my $cleanup_cmd = "$CWRAPPER cleanup";
my $ret = 0;
-# higher-ranked statements committed before lower-ranked.
+my $rank; #not used
foreach (@all_nodes) {
my ($path_ref, $rank) = @$_;
- if ($rank != $cur_rank) {
- # commit all nodes with the same rank together.
- $ret = 0; #system("$commit_cmd");
- if ($ret >> 8) {
- print OLDOUT "Commit failed at rank $cur_rank\n";
- print WARN "Commit failed at rank $cur_rank\n";
- system("$cleanup_cmd");
- # continue after cleanup (or should we abort?)
- }
- $cur_rank = $rank;
- }
my $cmd = "$CWRAPPER set " . (join ' ', @$path_ref);
# this debug file should be deleted before release
system("echo [$cmd] >> /tmp/foo");