diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-07-30 09:53:00 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-07-30 09:53:00 -0700 |
commit | dc4bd2c05375cece9d1c1281cbebbef40a09c4e4 (patch) | |
tree | 1ad940cb817d22726b1e1f763f12b0e11f3a5acc /lib/Vyatta/Config.pm | |
parent | 56dc9db80960f62f021958baba29c49dda895b03 (diff) | |
download | vyatta-cfg-dc4bd2c05375cece9d1c1281cbebbef40a09c4e4.tar.gz vyatta-cfg-dc4bd2c05375cece9d1c1281cbebbef40a09c4e4.zip |
add default status observers
Diffstat (limited to 'lib/Vyatta/Config.pm')
-rwxr-xr-x | lib/Vyatta/Config.pm | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/Vyatta/Config.pm b/lib/Vyatta/Config.pm index 8067e05..371fe32 100755 --- a/lib/Vyatta/Config.pm +++ b/lib/Vyatta/Config.pm @@ -53,8 +53,9 @@ sub get_path_comps { } ############################################################ -# low-level API functions that have been converted to use -# the cstore library. +# low-level API functions that use the cstore library directly. +# they are either new functions or old ones that have been +# converted to use cstore. ############################################################ ###### @@ -94,6 +95,24 @@ sub existsOrig { return; # note: this return is needed. } +## isDefault("path to node") +# Returns true if specified node is "default" in working config. +sub isDefault { + my ($self, $path) = @_; + return 1 + if ($self->{_cstore}->cfgPathDefault($self->get_path_comps($path), undef)); + return; # note: this return is needed. +} + +## isDefaultOrig("path to node") +# Returns true if specified node is "default" in active config. +sub isDefaultOrig { + my ($self, $path) = @_; + return 1 + if ($self->{_cstore}->cfgPathDefault($self->get_path_comps($path), 1)); + return; # note: this return is needed. +} + ## listNodes("level") # return array of all child nodes at "level" in working config. sub listNodes { |