Currently, the -l option and check-mode try to match entries against their literal entry. However, if /etc/genders contains host entries like "server[1-4]", as used with pdsh, this is useless. This patch expands those hostnames when matching. Normally, the output is as before, but if the -e option is added, the host entries are expanded on output (producing server1,server2,server3, etc instead of server[1-3]).
Examples:
server[1-4] servers
ws[0-9]-ms microsoft,workstations
ws[1-4]-linux linux,workstations
test[d-x] test
cluster[00-99]i cluster,infiniband
cluster[00-99]e cluster,ethernet
So "nodeattr -s -l cluster14i" will produce "cluster infiniband" and "nodeattr -s -l testg" will produce "test". You can also expand the hostnames, so that "nodeattr -s -e servers" produces "server1 server2 server3 server4". Doing the same with "cluster" would produce a very long list.
The regex used for expansion is \S+\[\w+-\w+\]\S*. Note, the pdsh allowance of a comma instead of - does not work here, since that would require a rewrite of the nodeattr parser.