[j-nsp] Commit script paths

Richard A Steenbergen ras at e-gerbil.net
Mon Apr 16 19:52:54 EDT 2007


On Mon, Apr 16, 2007 at 02:18:11PM -0400, Phil Shafer wrote:
> [Doing the Happy Dance over the first commit script question]
> 
> Richard A Steenbergen writes:
> >Maybe I'm missing something really obvious here, but how do you change
> >your current context (dot) to the top level in commit scripts (slax
> >specifically)?
> 
> The simplest way is to save the top before you descend:
> 
>     var $top = .;
>     for-each (protocols/bgp/group/neighbor[peer-as != 1234]) {
>         call jcs:emit-change($tag = 'transient-change', $dot = $top, ...);
>     }
> 
> Or you can find the node from the top:
> 
>     for-each (protocols/bgp/group/neighbor[peer-as != 1234]) {
>         var $top = /commit-script-input/configuration;
>         /* ... */
>     }

After much trial and error (lots of error) I found a way to fudge it by 
doing "//policy-options", but strangely enough it doesn't work for just 
"//", or "//groups/something/policy-options". Not sure if that is fully 
supported, but I figure it's worth noting for the mailing list archives 
incase someone else is trying the same thing I am. :)

-- 
Richard A Steenbergen <ras at e-gerbil.net>       http://www.e-gerbil.net/ras
GPG Key ID: 0xF8B12CBC (7535 7F59 8204 ED1F CC1C 53AF 4C41 5ECA F8B1 2CBC)


More information about the juniper-nsp mailing list