diff options
author | Michael Larson <slioch@slioch.vyatta.com> | 2010-05-27 11:37:20 -0700 |
---|---|---|
committer | Michael Larson <slioch@slioch.vyatta.com> | 2010-05-27 11:37:20 -0700 |
commit | 9afb59571b7de247fbd7482f30d90d7a37a32ef5 (patch) | |
tree | 5b569052aac4ff03dd37b0728446350902a3e818 | |
parent | bfa5000782062a62846f954d1afe1c570230cc52 (diff) | |
download | vyatta-cfg-9afb59571b7de247fbd7482f30d90d7a37a32ef5.tar.gz vyatta-cfg-9afb59571b7de247fbd7482f30d90d7a37a32ef5.zip |
fix for loading config for deactivated nodes. allows nested deactivates within a single set of deactivated commands. only preserves
the parent deactivated node in this case.
-rw-r--r-- | scripts/vyatta-activate-config.pl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/vyatta-activate-config.pl b/scripts/vyatta-activate-config.pl index 3eca90f..5d7b7ab 100644 --- a/scripts/vyatta-activate-config.pl +++ b/scripts/vyatta-activate-config.pl @@ -31,6 +31,14 @@ sub wanted { exit 1; } +sub wanted_local { + if ( $_ eq '.disable' ) { + #we'll supercede this .disable by the parent and remove this. + my $f = $File::Find::name; + `rm -f $f`; + } +} + sub check_parents { my @p = @_; my $l_dir = "$ENV{VYATTA_TEMP_CONFIG_DIR}/"; @@ -96,8 +104,8 @@ if ($action eq 'deactivate') { if (-e $active_dir) { #checks active children find( \&wanted, $active_dir ); } - if (-e $local_dir) { #checks locally commit children - find( \&wanted, $local_dir ); + if (-e $local_dir) { #checks locally commit children, will remove disabled children + find( \&wanted_local, $local_dir ); } #final check that walks up tree and checks if (check_parents(@path)) { #checks active and locally committed parents |