diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2008-07-07 14:35:36 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2008-07-07 14:35:36 -0700 |
commit | 9178dcb68c092976f9bed29c13dbd70cb26de3a1 (patch) | |
tree | 5a2bc6847d259919332af1632b24f69bab4a634c /scripts | |
parent | 93a148a78b577ced2cfaebdbe1659e3ecc58c4aa (diff) | |
download | vyatta-cfg-9178dcb68c092976f9bed29c13dbd70cb26de3a1.tar.gz vyatta-cfg-9178dcb68c092976f9bed29c13dbd70cb26de3a1.zip |
fix for bug 3323: skip deletions of nodes with default values when loading
a config file.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/VyattaConfigLoad.pm | 13 |
1 files changed, 12 insertions, 1 deletions
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; |