mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-21 02:30:21 +00:00
Merge pull request #1600 from immarvin/onmysqlsetup
fix [FVT]:mysqlsetup -i failed to setup database on sles12 #1413 ;refine the logic to determine hostname of the master
This commit is contained in:
@@ -405,12 +405,8 @@ if (($::INIT) && ($::xcatrunningmysql == 0))
|
||||
my $cmd = "grep master $sitefile";
|
||||
my @output = xCAT::Utils->runcmd($cmd, -1);
|
||||
my $hname;
|
||||
if ($::RUNCMD_RC != 0) # no entry in site table
|
||||
{
|
||||
$hname = `hostname`;
|
||||
chomp $hname;
|
||||
}
|
||||
else # from site.master
|
||||
# from site.master
|
||||
if ($::RUNCMD_RC == 0 )
|
||||
{
|
||||
(my $attr, my $master) = split(",", $output[0]);
|
||||
(my $q, $hname) = split("\"", $master);
|
||||
@@ -418,6 +414,11 @@ if (($::INIT) && ($::xcatrunningmysql == 0))
|
||||
|
||||
}
|
||||
|
||||
if( "$hname" eq ""){
|
||||
$hname = `hostname`;
|
||||
chomp $hname;
|
||||
}
|
||||
|
||||
#my ($name, $aliases, $addrtype, $length, @addrs) = gethostbyname($hname);
|
||||
my $ipaddr = xCAT::NetworkUtils->getipaddr($hname);
|
||||
if ($ipaddr)
|
||||
|
Reference in New Issue
Block a user