2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

Merge pull request #7039 from gurevichmark/xcatprobe-makedhcp

Better xcatprobe message when makedhcp -q returns no output
This commit is contained in:
besawn 2021-09-30 13:06:55 -04:00 committed by GitHub
commit 033f8ae900
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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`;