From d3cb3298228bea80b412b09c8ebf9cf1c39a503e Mon Sep 17 00:00:00 2001 From: ligc Date: Wed, 1 Sep 2010 08:17:57 +0000 Subject: [PATCH] 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 --- perl-xCAT/xCAT/FSPUtils.pm | 13 +++++++++++-- xCAT-server/lib/perl/xCAT/PPC.pm | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/FSPUtils.pm b/perl-xCAT/xCAT/FSPUtils.pm index 619571d77..0c858873f 100644 --- a/perl-xCAT/xCAT/FSPUtils.pm +++ b/perl-xCAT/xCAT/FSPUtils.pm @@ -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; diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm index 8d9532fbf..1e6e81425 100644 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -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;