mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-05-05 16:49:08 +00:00
fix: fail nodeset when MASTER_IP cannot be resolved
Template.pm silently continued rendering kickstart templates when
getipaddr() failed to resolve the master hostname, producing
kickstarts with an empty MASTER_IP. Nodes would install successfully
but fail on first reboot when post.xcat and xcatinstallpost tried
to contact the master, timing out after 90 retries with:
the network between the node and is not ready
Postage.pm (mypostscript generation) already checks for this and
returns a clear error. Apply the same pattern in Template.pm so
nodeset fails immediately with a descriptive message instead of
producing a broken kickstart.
Fixes #7544
This commit is contained in:
@@ -123,9 +123,11 @@ sub subvars {
|
||||
|
||||
$ENV{XCATMASTER} = $master;
|
||||
my $ipaddr = xCAT::NetworkUtils->getipaddr($master);
|
||||
if ($ipaddr) {
|
||||
$ENV{MASTER_IP} = "$ipaddr";
|
||||
unless ($ipaddr) {
|
||||
$tmplerr = "Unable to resolve master \"$master\" to an IP address for $node";
|
||||
return;
|
||||
}
|
||||
$ENV{MASTER_IP} = "$ipaddr";
|
||||
|
||||
my @nodestatus = xCAT::TableUtils->get_site_attribute("nodestatus");
|
||||
my $tmp = $nodestatus[0];
|
||||
|
||||
Reference in New Issue
Block a user