summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-05-15 20:33:44 -0700
committerslioch <slioch@eng-140.vyatta.com>2009-05-15 20:33:44 -0700
commit7a82196d79f6b755db514e002216340223e61de7 (patch)
tree660fcc052fb5bb2e479089eb65c8b9501f6f06e5 /lib
parentdeb86bf2b27631f66e5ffd849ba45db895dbd091 (diff)
downloadvyatta-cfg-7a82196d79f6b755db514e002216340223e61de7.tar.gz
vyatta-cfg-7a82196d79f6b755db514e002216340223e61de7.zip
root node support on load merge operation. additional work needed for deeper merge path support
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Vyatta/ConfigLoad.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Vyatta/ConfigLoad.pm b/lib/Vyatta/ConfigLoad.pm
index c1ea5e7..a1c0b8f 100755
--- a/lib/Vyatta/ConfigLoad.pm
+++ b/lib/Vyatta/ConfigLoad.pm
@@ -225,10 +225,21 @@ sub loadConfigHierarchy {
if (!defined($load_cfg)) {
return ();
}
+
+ #allows loading from arbritary root
+ my $root_node = shift;
my $xcp = new XorpConfigParser();
$xcp->parse($load_cfg);
- my $root = $xcp->get_node( () );
+ my $root;
+ if (defined($root_node)) {
+ my $tmp = [$root_node];
+ $root = $xcp->get_node($tmp);
+ #root_path= --except last node and needs to be passed to enumerate_branch
+ }
+ else {
+ $root = $xcp->get_node( () );
+ }
if (!defined($root)) {
return ();
}