[Dev] Interface Up/Down

Ryan Kruse rkruse at alterpoint.com
Mon May 19 10:27:52 CDT 2008


Cool stuff.  I changed the underlying tool to understand the grid input.

________________________________
From: dev-bounces at ziptie.org [mailto:dev-bounces at ziptie.org] On Behalf Of Brett Wooldridge
Sent: Saturday, May 17, 2008 11:46 PM
To: ZipTie Development List
Subject: [Dev] Interface Up/Down

Ryan,

I "fixed" (read "broke") your interface up/down tool.  It now uses a new 'grid' input contributor which uses XPath to populate the grid with both the current up/down status of the interface as well as the interface name in a grid.  Probably broke in this case, because the input generated by the grid tool is a CSV for each selected item in the grid (I'm trying not to get too tricky by allowing specific column input determination).

So in the case of the 'old' list input it was using, if there was a list like so:

loopback0
loopback1
fastethernet0

Your tool might get:

"loopback0","fastethernet0"

as it's input.  In the case of the new grid control the grid contains something like

up    loopback0
down  loopback1
up    fastethernet0

In which case, your tool input will be a properly escaped CSV like so:

"up,loopback0","down,fastethernet0"

Obviously, your tool can choose to ignore the current up/down status reflected in the input, but will have to deal with it enough to know to ignore it.

If you play around with it you'll note that there is no way using XPath with our document structure to generate a grid like so:

loopback0     up
loopback1     down
fastethernet0 up

This is because of our decision to use 'tags' rather than 'attributes' on nodes like interface.  If they were attributes we could chose the selection order, but as nodes the result will always be in "document order" and because "adminStatus" occurs before "name" in the document it will always be emitted first by XPath.  Cest la vie.

Anyway, sorry for breaking your tool.  It was for the greater good of mankind.

-Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ziptie.org/pipermail/dev/attachments/20080519/66db34b2/attachment.html 


More information about the Dev mailing list