summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Config.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta/Config.pm')
-rwxr-xr-xlib/Vyatta/Config.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/Vyatta/Config.pm b/lib/Vyatta/Config.pm
index e4d74bb..91f8101 100755
--- a/lib/Vyatta/Config.pm
+++ b/lib/Vyatta/Config.pm
@@ -22,6 +22,7 @@ package Vyatta::Config;
use strict;
use Vyatta::ConfigDOMTree;
+use File::Find;
my %fields = (
_changes_only_dir_base => $ENV{VYATTA_CHANGES_ONLY_DIR},
@@ -546,6 +547,28 @@ sub listDeleted {
return @deleted;
}
+## getAllDeactivated()
+# returns array of all deactivated nodes.
+#
+my @all_deactivated_nodes;
+sub getAllDeactivated {
+ my ($self, $path) = @_;
+ my $start_dir = $self->{_active_dir_base};
+ find ( \&wanted, $start_dir );
+ return @all_deactivated_nodes;
+}
+sub wanted {
+ if ( $_ eq '.disable' ) {
+ my $f = $File::Find::name;
+ #now strip off leading path and trailing file
+ $f = substr($f, length($ENV{VYATTA_ACTIVE_CONFIGURATION_DIR}));
+ $f = substr($f, 0, length($f)-length("/.disable"));
+ $f =~ s/\// /g;
+ push @all_deactivated_nodes, $f;
+ }
+}
+
+
## isDeactivated("node")
# returns back whether this node is in an active (false) or
# deactivated (true) state.