2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-07-24 05:11:12 +00:00

Better xcatprobe message when makedhpc -q returns no output

This commit is contained in:
Mark Gurevich
2021-09-27 10:21:58 -04:00
parent 100f455215
commit f6a81f14dd

View File

@@ -1143,8 +1143,15 @@ sub check_dhcp_service {
last;
}
chomp($tmp);
if (length($tmp) == 0) {
# makedhcp -q did not return anything, and RC was 0
push @$error_ref, "DHCP server returned no data for 'makedhcp -q xcatmntest'";
returncmdoutput($tmp, $error_ref) if ($verbose);
$rc = 1;
last;
}
if ($tmp !~ /xcatmntest: ip-address = $serverip, hardware-address = aa:aa:aa:aa:aa:aa/) {
push @$error_ref, "DHCP server reply is wrong";
push @$error_ref, "DHCP server reply does not match expected IP and MAC";
returncmdoutput($tmp, $error_ref) if ($verbose);
$rc = 1;
`makedhcp -d xcatmntest 2>&1 && rmdef xcatmntest 2>&1`;