[j-nsp] jcs:split() function with errors
ben b
benboyd.lists at gmail.com
Fri Jul 22 14:37:51 EDT 2011
Slax dudes,
i'm running into a weird issue that i can't seem to figure out...
i'm try to find out the number of pipes "|" in all of my interface
descriptions, but for some reason the jcs:split() function errors out in my
commit script. Does anyone have any suggestions?
junos version 10.0R3.10
code:
/* Loop through all logical interfaces checking for descriptions and
format*/
for-each( interfaces/interface/unit ) {
/* Missing description */
if( jcs:empty( description ) ) {
<xnm:error> {
call jcs:edit-path();
<message> "!!!CONFIGURATION ERROR!!! Interface description is MISSING.
Format = 'INTERFACE TYPE | CIRCUIT ID | CONNECTING ROUTER | CONNECTING PORT
| FUNCTION'";
}
}
else {
var $description_parts = jcs:split("|", description);
/*
if ( not($description_parts[5]) ) {
<xnm:error> {
call jcs:edit-path();
<message> "!!!CONFIGURATION ERROR!!! Interface description is INCORRECT.
Format = 'INTERFACE TYPE | CIRCUIT ID | CONNECTING ROUTER | CONNECTING PORT
| FUNCTION'";
}
}
*/
}
}
when i comment out
var $description_parts = jcs:split("|", description);
i don't run into errors
I have 4 interface descriptions, and when i commit, this is all i see:
error: 4 errors reported by commit scripts
error: commit script failure
More information about the juniper-nsp
mailing list