diff options
Diffstat (limited to 'lib/Vyatta')
-rwxr-xr-x | lib/Vyatta/Config.pm | 23 | ||||
-rwxr-xr-x | lib/Vyatta/ConfigLoad.pm | 4 |
2 files changed, 23 insertions, 4 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 { diff --git a/lib/Vyatta/ConfigLoad.pm b/lib/Vyatta/ConfigLoad.pm index d3d7dbb..55ba76b 100755 --- a/lib/Vyatta/ConfigLoad.pm +++ b/lib/Vyatta/ConfigLoad.pm @@ -401,8 +401,8 @@ sub getConfigDiff { $file; } @{${$del}[0]}; - my ($is_multi, $is_text, $default) - = $active_cfg->parseTmpl(join ' ', @comps); + $active_cfg->setLevel(join ' ', @comps); + my ($is_multi, $is_text, $default) = $active_cfg->parseTmpl(); if (!defined($default)) { push @new_delete_list, $del; } |