From 7a82196d79f6b755db514e002216340223e61de7 Mon Sep 17 00:00:00 2001 From: slioch Date: Fri, 15 May 2009 20:33:44 -0700 Subject: root node support on load merge operation. additional work needed for deeper merge path support --- lib/Vyatta/ConfigLoad.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib') 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 (); } -- cgit v1.2.3