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_ngcp_neighbours

31 lines
632 B

[%
# vi: ft=tt2
# Return an array of name for all neighbours (all nodes without self).
#
# @param argv.status node status [ online, offline, inactive ]
# default value: ['online', 'inactive']
# @return out The array of fields "name", e.g.: [ 'sp1', 'sp2' ]
IF !argv.status.size;
argv.status = ['online', 'inactive'];
END;
status = {
online = 0
offline = 0
inactive = 0
};
FOREACH val IN argv.status;
status.$val = 1;
END;
out = [];
FOREACH host IN hosts.keys.sort;
NEXT UNLESS status.item(hosts.$host.status);
NEXT IF host == ngcp.get_hostname();
out.push( host );
END;
-%]