List Info

Thread: Commit script paths




Commit script paths
country flaguser name
United States
2007-04-06 18:50:10
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)?

Say for example:

    for-each (protocols/bgp/group/neighbor[peer-as != 1234])
{
        some code here;
    }

    /* . has now been changed to
protocols/bgp/group/neighbor */

    call jcs:emit-change($tag = 'transient-change', $dot =
???????) {
        path is wrong here, still in
protocols/bgp/group/neighbor
    }

How could you specify something like
"/policy-options" as the dot, without 
having to go ../../../..? I've tried everything I could
think of which 
might be obvious, "policy-options"
"/policy-options" "/" "root" 
"configuration" with and without quotes, and
nothing seems to work. Every 
example commit script seems to deal with moving down in the
path, or up 
one branch, but nothing seems to actually reset to root.


-- 
Richard A Steenbergen <rase-gerbil.net>       http://www.e-gerbil.net/r
as
GPG Key ID: 0xF8B12CBC (7535 7F59 8204 ED1F CC1C 53AF 4C41
5ECA F8B1 2CBC)
_______________________________________________
juniper-nsp mailing list juniper-nsppuck.nether.net

https://puck.nether.net/mailman/listinfo/juniper-nsp

Re: Commit script paths
country flaguser name
United States
2007-04-16 13:18:11
[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;
        /* ... */
    }

Thanks,
 Phil
_______________________________________________
juniper-nsp mailing list juniper-nsppuck.nether.net

https://puck.nether.net/mailman/listinfo/juniper-nsp

Re: Commit script paths
country flaguser name
United States
2007-04-16 18:52:54
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 <rase-gerbil.net>       http://www.e-gerbil.net/r
as
GPG Key ID: 0xF8B12CBC (7535 7F59 8204 ED1F CC1C 53AF 4C41
5ECA F8B1 2CBC)
_______________________________________________
juniper-nsp mailing list juniper-nsppuck.nether.net

https://puck.nether.net/mailman/listinfo/juniper-nsp

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )