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:
ligc 2010-09-01 08:17:57 +00:00
parent 3be5d3dec2
commit d3cb329822
2 changed files with 13 additions and 4 deletions

View File

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

View File

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