mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-09 14:36:43 +00:00
947c624b3c
`makedhcp -q <node>` on Ubuntu's ISC-limited releases answers "no DHCP reservation found" when it cannot read dhcpd.conf. The operator reads that as a node without a reservation. An InfiniBand node also gets an answer with no hardware address. _query_isc_static_host in dhcp.pm read the file with an -r test and dropped a failed open. It also matched only a "hardware ethernet" line, while _add_isc_static_host writes "hardware infiniband" for an InfiniBand node and adds a twin declaration between the same markers. _read_isc_conf_lines now returns the read error, _query_isc_static_host returns it to listnode, and listnode answers the caller with an error. The parser accepts any hardware type and keeps the first declaration of the block. The path of dhcpd.conf and the distribution name are package variables, so a test can drive the query and listnode. dhcp_isc_static_host_query.t covers the InfiniBand address, the twin declaration, the unreadable file and the listnode answer. It fails without this change. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>