diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-06-23 15:22:07 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-06-23 15:22:07 -0700 |
commit | a12ea86c1f091ed9f7161179f0939c8b33da5394 (patch) | |
tree | 9dc6aed2a72bc5e3381557f966918400a1dfe0f2 /lib | |
parent | 6b42d818585a4f10cfb5af55bc8d09cee27284da (diff) | |
download | vyatta-cfg-a12ea86c1f091ed9f7161179f0939c8b33da5394.tar.gz vyatta-cfg-a12ea86c1f091ed9f7161179f0939c8b33da5394.zip |
remove unneeded API function
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Vyatta/Config.pm | 48 | ||||
-rwxr-xr-x | lib/Vyatta/ConfigOutput.pm | 2 |
2 files changed, 1 insertions, 49 deletions
diff --git a/lib/Vyatta/Config.pm b/lib/Vyatta/Config.pm index be1537b..8bcd84f 100755 --- a/lib/Vyatta/Config.pm +++ b/lib/Vyatta/Config.pm @@ -272,54 +272,6 @@ sub listOrigNodes { return @nodes_modified; } -## listOrigNodes("level") -# return array of all original nodes (i.e., before any current change; i.e., -# in "working") at "level" -# level is relative -sub listOrigNodesNoDef { - my ($self, $path, $disable) = @_; - my @nodes = (); - - my $rpath = ""; - if (defined $path) { - $path =~ s/\//%2F/g; - $path =~ s/\s+/\//g; - $rpath = $self->{_current_dir_level} . "/" . $path; - } - else { - $rpath = $self->{_current_dir_level}; - } - $path = $self->{_active_dir_base} . $rpath; - - #print "DEBUG Vyatta::Config->listNodes(): path = $path\n"; - opendir my $dir, $path or return (); - @nodes = grep !/^\./, readdir $dir; - closedir $dir; - - my @nodes_modified = (); - while (@nodes) { - my $tmp = pop (@nodes); - $tmp =~ s/\n//g; - my $ttmp = $rpath . "/" . $tmp; - $tmp =~ s/%2F/\//g; - $ttmp =~ s/\// /g; - #print "DEBUG Vyatta::Config->listNodes(): node = $tmp\n"; - if ($tmp ne 'def') { - if (!defined $disable) { - my ($status, undef) = $self->getDeactivated($ttmp); - if (!defined($status) || $status eq 'active') { - push @nodes_modified, $tmp; - } - } - else { - push @nodes_modified, $tmp; - } - } - } - - return @nodes_modified; -} - ## returnParent("level") # return the name of parent node relative to the current hierarchy # in this case "level" is set to the parent dir ".. .." diff --git a/lib/Vyatta/ConfigOutput.pm b/lib/Vyatta/ConfigOutput.pm index 10cd5f2..1218a8d 100755 --- a/lib/Vyatta/ConfigOutput.pm +++ b/lib/Vyatta/ConfigOutput.pm @@ -231,7 +231,7 @@ sub displayDeletedOrigChildren { $config->setLevel(join ' ', (@cur_path, $child)); - my @cnames = sort $config->listOrigNodesNoDef(undef,'true'); + my @cnames = grep(!/^def$/, sort($config->listOrigNodes(undef,'true'))); if ($cnames[0] eq 'node.val') { displayValues([ @cur_path, $child ], $dis, $prefix, $child, |