fix for 4261: add the getnodesetstat support for grub2

This commit is contained in:
ligc 2013-08-29 15:15:56 +08:00
parent ef94ee5642
commit d7081292fc

17
xCAT-server/lib/perl/xCAT/SvrUtils.pm Normal file → Executable file
View File

@ -53,6 +53,7 @@ sub getNodesetStates
my @pxenodes = ();
my @yabootnodes = ();
my @xnbanodes= ();
my @grub2nodes = ();
my $tabdata = $tab->getNodesAttribs(\@nodes, ['node', 'netboot']);
foreach my $node (@nodes)
{
@ -75,6 +76,10 @@ sub getNodesetStates
{
push(@aixnodes, $node);
}
elsif ($nb eq "grub2")
{
push(@grub2nodes, $node);
}
}
my @retarray;
@ -131,6 +136,18 @@ sub getNodesetStates
xCAT::MsgUtils->message('E', $retarray[1]);
}
}
if (@grub2nodes > 0)
{
require xCAT_plugin::grub2;
@retarray =
xCAT_plugin::grub2::getNodesetStates(\@grub2nodes, $hashref);
if ($retarray[0])
{
$retcode = $retarray[0];
$errormsg .= $retarray[1];
xCAT::MsgUtils->message('E', $retarray[1]);
}
}
}
return (0, "");
}