diff options
author | rbalocca <rbalocca@vyatta.com> | 2008-07-09 12:22:04 -0700 |
---|---|---|
committer | rbalocca <rbalocca@vyatta.com> | 2008-07-09 12:22:04 -0700 |
commit | a1561f2b43a221651f1b370296a205be772c2ff6 (patch) | |
tree | 20f719fd409d57fb93c67d6a6c0be37d9598b02a /scripts/VyattaConfigLoad.pm | |
parent | 7db066e99a5e9c3b41ce30d19b9781b1a8df8d44 (diff) | |
parent | 42d6c942800e2273b77ea92371ffdcb3f183163f (diff) | |
download | vyatta-cfg-a1561f2b43a221651f1b370296a205be772c2ff6.tar.gz vyatta-cfg-a1561f2b43a221651f1b370296a205be772c2ff6.zip |
Merge branch 'hollywood'
Diffstat (limited to 'scripts/VyattaConfigLoad.pm')
-rwxr-xr-x | scripts/VyattaConfigLoad.pm | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/VyattaConfigLoad.pm b/scripts/VyattaConfigLoad.pm index f1339c3..c8563bb 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 = (); @@ -296,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; @@ -396,8 +394,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; |