3.15 will have some new attribute expression capabilities. As a refresher, the
attribute expressions can be like:
r{n1}e1 (extract first number from node name, put it in {n1} location, r3u21
would yield r3e1)
location.u={n2} (r3u21 would yield 21)
swp{location.u} (pull the location.u value and put it after swp), in above,
this would be swp21
Also, not documented, but already implemented, you can slice with [:] syntax:
n1-prv with {node[:-3]}ib becomes n1-ib
prv-n1 with {node[4:]} becomes n1
3.15 will bring a replace function, so:
{node.replace('-prv', '-ib')} will work.
Also added will be upper() and lower(), since those are easy.
I want to add two more functions, but unsure what to name them. Today you can
group and index things using math, e.g. to make a range repeat 1 to 4 in groups
of 4, e.g. to say 'chassis 1, bay 1, 2, 3, 4', then 'chassis 2, bay 1,2,3,4'
you can do:
{(n1-1)/4+1} and {(n1-1)%4+1}
(Since people tend to count ports and bays and nodes by 1, you have to do the
-1, +1 adjustment to make the math work out).
Since this is fairly common, but a bit confusing, I was thinking of making
functions for doing this, like maybe:
{node.chunk(4)} and {node.chunk_offset(4)} to request the 1-based divide by
four and then remainder. I was wondering if people thought this would be
easier and if so, what would be good names for these functions.
_______________________________________________
xCAT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xcat-user