fix for bug 3056449: call MsgUtils::message with callback
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7332 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
3be5d3dec2
commit
d3cb329822
@ -225,14 +225,23 @@ sub getTypeOfNode
|
||||
{
|
||||
my $class = shift;
|
||||
my $node = shift;
|
||||
my $callback = shift;
|
||||
|
||||
my $nodetypetab = xCAT::Table->new( 'nodetype');
|
||||
|
||||
xCAT::MsgUtils->message('E', "Failed to open table 'nodetype'.") if ( ! $nodetypetab);
|
||||
if (!$nodetypetab) {
|
||||
my $rsp;
|
||||
$rsp->{errorcode}->[0] = [1];
|
||||
$rsp->{data}->[0]= "Failed to open table 'nodetype'";
|
||||
xCAT::MsgUtils->message('E', $rsp, $callback);
|
||||
}
|
||||
my $nodetype_hash = $nodetypetab->getNodeAttribs( $node,[qw(nodetype)]);
|
||||
my $nodetype = $nodetype_hash->{nodetype};
|
||||
if ( !$nodetype) {
|
||||
xCAT::MsgUtils->message('E', "Not found the $node\'s nodetype");
|
||||
my $rsp;
|
||||
$rsp->{errorcode}->[0] = [1];
|
||||
$rsp->{data}->[0]= "Not found the $node\'s nodetype";
|
||||
xCAT::MsgUtils->message('E', $rsp, $callback);
|
||||
return undef;
|
||||
}
|
||||
return $nodetype;
|
||||
|
@ -1733,7 +1733,7 @@ sub process_request {
|
||||
}#end of if
|
||||
#print "thishcp:$thishcp\n";
|
||||
#get the nodetype of hcp:
|
||||
my $thishcp_type = xCAT::FSPUtils->getTypeOfNode($thishcp);
|
||||
my $thishcp_type = xCAT::FSPUtils->getTypeOfNode($thishcp,$callback);
|
||||
if(!defined($thishcp_type)) {
|
||||
$request = {};
|
||||
next;
|
||||
@ -1966,7 +1966,7 @@ sub getHCPsOfNodes
|
||||
my %hcps = ();
|
||||
#get hcp from ppc.
|
||||
foreach my $node( @$nodes) {
|
||||
my $thishcp_type = xCAT::FSPUtils->getTypeOfNode($node);
|
||||
my $thishcp_type = xCAT::FSPUtils->getTypeOfNode($node, $callback);
|
||||
if( $thishcp_type eq "hmc") {
|
||||
$hcps{$node}{hcp} = [$node];
|
||||
$hcps{$node}{num} = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user