diff options
author | Michael Larson <slioch@slioch.vyatta.com> | 2010-05-05 16:50:44 -0700 |
---|---|---|
committer | Michael Larson <slioch@slioch.vyatta.com> | 2010-05-05 16:50:44 -0700 |
commit | 0d020c8b938443ac8875bcfcff231dd1bf0d1d41 (patch) | |
tree | 1f82593a10110b9b2872992e3dcdfe5a19115e32 /lib/Vyatta/Config.pm | |
parent | 0ffdc5e6d89f9677694a8eef916b07c089264753 (diff) | |
download | vyatta-cfg-0d020c8b938443ac8875bcfcff231dd1bf0d1d41.tar.gz vyatta-cfg-0d020c8b938443ac8875bcfcff231dd1bf0d1d41.zip |
boot loader support now added. various bug fixes and some small rework.
Diffstat (limited to 'lib/Vyatta/Config.pm')
-rwxr-xr-x | lib/Vyatta/Config.pm | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/Vyatta/Config.pm b/lib/Vyatta/Config.pm index 8de3aba..82d835f 100755 --- a/lib/Vyatta/Config.pm +++ b/lib/Vyatta/Config.pm @@ -532,6 +532,7 @@ sub getDeactivated { my ($self, $node) = @_; if (!defined $node) { + $node = $self->{_level}; } # let's setup the filepath for the change_dir @@ -634,7 +635,7 @@ sub isAdded { # node name is the hash key. node status is the hash value. # node status can be one of deleted, added, changed, or static sub listNodeStatus { - my ($self, $path) = @_; + my ($self, $path, $disable) = @_; my @nodes = (); my %nodehash = (); @@ -647,15 +648,20 @@ sub listNodeStatus { @nodes = (); @nodes = $self->listNodes($path); foreach my $node (@nodes) { - if ($node =~ /.+/) { - my $nodepath = $node; - $nodepath = "$path $node" if ($path); - #print "DEBUG Vyatta::Config->listNodeStatus(): node $node\n"; - # No deleted nodes -- added, changed, ot static only. - if ($self->isAdded($nodepath)) { $nodehash{$node} = "added"; } - elsif ($self->isChanged($nodepath)) { $nodehash{$node} = "changed"; } - else { $nodehash{$node} = "static"; } - } + if ($node =~ /.+/) { + my $status = undef; + if (!defined $disable) { + ($status,undef) = $self->getDeactivated($self->{_level}." ".$node); + } + my $nodepath = $node; + $nodepath = "$path $node" if ($path); + #print "DEBUG Vyatta::Config->listNodeStatus(): node $node\n"; + # No deleted nodes -- added, changed, ot static only. + if (defined $status && $status eq 'local') { $nodehash{$node} = "deleted"; } + elsif ($self->isAdded($nodepath)) { $nodehash{$node} = "added"; } + elsif ($self->isChanged($nodepath)) { $nodehash{$node} = "changed"; } + else { $nodehash{$node} = "static"; } + } } return %nodehash; |