You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcpcfg/lib/get_firstname

20 lines
425 B

[%
# vi: ft=tt2
# Returns the (alphabetically) first hostname of a node pair for a given host.
#
# @param argv.host The hostname to get the first name for.
# @return out The alphabetically first name.
IF !hosts.${argv.host}.defined;
argv.host = 'self';
END;
blktmp.hosts = [argv.host];
IF hosts.${argv.host}.peer.defined;
blktmp.hosts.push(hosts.${argv.host}.peer);
END;
out = blktmp.hosts.sort.0;
-%]