diff options
author | Michael Larson <slioch@slioch.vyatta.com> | 2010-06-05 20:03:10 -0700 |
---|---|---|
committer | Michael Larson <slioch@slioch.vyatta.com> | 2010-06-05 20:03:10 -0700 |
commit | 0436bee24b3a34d4b3654b94b96159f3c3f3fd08 (patch) | |
tree | a1a3015161e5ce0bc30438b9bea027449b65257b /lib | |
parent | 6fcaf773333e0285464e774751c95b79ec9c4ff5 (diff) | |
download | vyatta-cfg-0436bee24b3a34d4b3654b94b96159f3c3f3fd08.tar.gz vyatta-cfg-0436bee24b3a34d4b3654b94b96159f3c3f3fd08.zip |
fix for bug 5643. API changes missed exists(). flag check added.
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Vyatta/Config.pm | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/Vyatta/Config.pm b/lib/Vyatta/Config.pm index 93a2478..f3b1614 100755 --- a/lib/Vyatta/Config.pm +++ b/lib/Vyatta/Config.pm @@ -571,13 +571,22 @@ sub returnOrigValues { } ## exists("node") -# Returns true if the "node" exists. +# Returns true if the "node" exists. sub exists { - my ( $self, $node ) = @_; - $node =~ s/\//%2F/g; - $node =~ s/\s+/\//g; - - return ( -d "$self->{_new_config_dir_base}$self->{_current_dir_level}/$node" ); + my ( $self, $node, $disable ) = @_; + $node =~ s/\//%2F/g; + $node =~ s/\s+/\//g; + #getDeactivated() + my $ttmp = $self->{_current_dir_level} . "/" . $node; + $ttmp =~ s/\// /g; + if (!defined $disable) { + my ($status, undef) = $self->getDeactivated($ttmp); + #only return value if status is not disabled (i.e. local or both) + if (defined($status) && ($status eq 'both' || $status eq 'local')) { #if a .disable is in local or active or both then return false + return; + } + } + return ( -d "$self->{_new_config_dir_base}$self->{_current_dir_level}/$node" ); } ## existsOrig("node") |