diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-27 17:26:33 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-27 17:26:33 -0800 |
commit | 79b6f234a4905e5f96a65526f2a72fa41cc1d331 (patch) | |
tree | a95bf2779163eb754e1c3fc8fad17276a87d976b /scripts/VyattaConfig.pm | |
parent | e937ae5d376b03e89f8ade6e6c015979f59fa363 (diff) | |
download | vyatta-cfg-79b6f234a4905e5f96a65526f2a72fa41cc1d331.tar.gz vyatta-cfg-79b6f234a4905e5f96a65526f2a72fa41cc1d331.zip |
distinguish deleted and nonexistent nodes in show output.
Diffstat (limited to 'scripts/VyattaConfig.pm')
-rw-r--r-- | scripts/VyattaConfig.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/VyattaConfig.pm b/scripts/VyattaConfig.pm index 1645be6..476d586 100644 --- a/scripts/VyattaConfig.pm +++ b/scripts/VyattaConfig.pm @@ -220,6 +220,20 @@ sub exists { } } +## existsOrig("node") +# Returns true if the "original node" exists. +sub existsOrig { + my ( $self, $node ) = @_; + $node =~ s/\//%2F/g; + $node =~ s/\s+/\//g; + + if ( -d "$self->{_active_dir_base}$self->{_current_dir_level}/$node" ) { + return 1; + } else { + return undef; + } +} + ## isDeleted("node") # is the "node" deleted. node is relative. returns true or false sub isDeleted { |