From c1996ea96f991e641af8f62efa63a133db0f9814 Mon Sep 17 00:00:00 2001 From: slioch Date: Mon, 18 May 2009 13:42:52 -0700 Subject: now explicit root merge works up to first multinode with explicit path --- lib/Vyatta/ConfigLoad.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Vyatta/ConfigLoad.pm b/lib/Vyatta/ConfigLoad.pm index a1c0b8f..09bd627 100755 --- a/lib/Vyatta/ConfigLoad.pm +++ b/lib/Vyatta/ConfigLoad.pm @@ -232,10 +232,13 @@ sub loadConfigHierarchy { my $xcp = new XorpConfigParser(); $xcp->parse($load_cfg); my $root; + my @root_path; if (defined($root_node)) { - my $tmp = [$root_node]; + my $tmp = [split("/",$root_node)]; $root = $xcp->get_node($tmp); - #root_path= --except last node and needs to be passed to enumerate_branch + my @tmp2 = split("/",$root_node); + @root_path = pop(@tmp2); + @root_path = @tmp2; } else { $root = $xcp->get_node( () ); @@ -243,7 +246,7 @@ sub loadConfigHierarchy { if (!defined($root)) { return (); } - enumerate_branch($root, ( )); + enumerate_branch($root, @root_path); return generateHierarchy(\@all_naked_nodes); } -- cgit v1.2.3 From 8e3b81d1a13f35d4b419fe9af6da2e0b7fa64a64 Mon Sep 17 00:00:00 2001 From: slioch Date: Mon, 18 May 2009 14:04:51 -0700 Subject: notes on arbitrary root node loading in merge operations. --- scripts/vyatta-load-config.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl index 6755015..a3cf6ef 100755 --- a/scripts/vyatta-load-config.pl +++ b/scripts/vyatta-load-config.pl @@ -38,6 +38,19 @@ my $load_file = $bootpath . "/config.boot"; my $url_tmp_file = $bootpath . "/config.boot.$$"; +# +# Note: to get merge to work on arbitrary nodes +# within the configuration multinodes need to be escaped. +# i.e.: +# load --merge='load-balancing/wan/interface-health\ eth0' +# +# will start loading of the configuration node from: +# +# load-balancing/wan/interface-health:eth0 +# +# Note current loading is limited to first new +# multinode. +# sub usage() { print "Usage: $0 --merge=\n"; exit 0; -- cgit v1.2.3