summaryrefslogtreecommitdiff
path: root/lib/Vyatta
diff options
context:
space:
mode:
authorRobert Bays <robert@vyatta.com>2010-08-30 15:47:01 -0700
committerRobert Bays <robert@vyatta.com>2010-08-30 15:47:01 -0700
commit0cba88a9b7a7439741f1b371a9c290e41380c91b (patch)
tree15373235080940ebb4ef34cd2df29e6b42a8a2d7 /lib/Vyatta
parent3fb0bdfb2a7c61f0b5d500d15381cbcdaeceb548 (diff)
parenta785fe685d9fa0edd813e2a53f1ebbc227ba2c7f (diff)
downloadvyatta-cfg-quagga-0cba88a9b7a7439741f1b371a9c290e41380c91b.tar.gz
vyatta-cfg-quagga-0cba88a9b7a7439741f1b371a9c290e41380c91b.zip
Merge commit 'a785fe685d9fa0edd813e2a53f1ebbc227ba2c7f' into mendocino
Conflicts: debian/changelog scripts/bgp/vyatta-bgp.pl
Diffstat (limited to 'lib/Vyatta')
-rw-r--r--lib/Vyatta/Quagga/Config.pm28
1 files changed, 24 insertions, 4 deletions
diff --git a/lib/Vyatta/Quagga/Config.pm b/lib/Vyatta/Quagga/Config.pm
index 644024e5..8afc1bed 100644
--- a/lib/Vyatta/Quagga/Config.pm
+++ b/lib/Vyatta/Quagga/Config.pm
@@ -342,9 +342,8 @@ sub _qtree {
$qcom = $_qcomref;
- # It's ugly that I have to create a new Vyatta config object every time,
- # but something gets messed up on the stack if I don't. not sure
- # what yet. would love to reference a global config and just reset Level.
+ # Would love to reference a global config and just reset Levels,
+ # but Vyatta::Config isn't recursion safe.
my $config = new Vyatta::Config;
$config->setLevel($level);
@@ -356,7 +355,28 @@ sub _qtree {
else {
$vtysh = \%_vtyshdel;
@nodes = $config->listDeleted();
- }
+
+ # handle special case for multi-nodes values being deleted
+ # listDeleted() doesn't return the node as deleted if it is a multi
+ # unless all values are deleted.
+ # TODO: fix listDeleted() in Config.pm
+ # This is really, really fugly.
+ my @all_nodes = $config->listNodes();
+ foreach my $node (@all_nodes) {
+ my @array = split /\s+/, $level;
+ push @array, $node;
+ my ($multi, $text, $default) = $config->parseTmpl(\@array);
+ if ($multi) {
+ my @orig_values = $config->returnOrigValues("$node");
+ my @new_values = $config->returnValues("$node");
+ my %chash = $config->compareValueLists(\@orig_values, \@new_values);
+ if (${$chash{'deleted'}}[0]) {
+ push @nodes, $node;
+ }
+ }
+ }
+
+ } ## end else {
if ($_DEBUG) { print "DEBUG: _qtree - action: $action\tlevel: $level\n"; }