From 56d468f66934d00d7dbb24d4a4995d6518c23bbf Mon Sep 17 00:00:00 2001 From: daniceexi Date: Fri, 13 Mar 2015 04:52:55 -0400 Subject: [PATCH] defect 4603: fix the code logic of how to get the fsp of cec --- xCAT-server/lib/xcat/plugins/energy.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/energy.pm b/xCAT-server/lib/xcat/plugins/energy.pm index ab6346b3d..e83d9c421 100644 --- a/xCAT-server/lib/xcat/plugins/energy.pm +++ b/xCAT-server/lib/xcat/plugins/energy.pm @@ -345,7 +345,7 @@ sub process_request { unless (@ppc_all_entry) { @ppc_all_entry = $ppc_tab->getAllNodeAttribs(['node', 'parent', 'hcp', 'nodetype']); foreach my $ppcentry (@ppc_all_entry) { - if (defined($ppcentry->{parent})) { + if (defined($ppcentry->{parent}) && defined($ppcentry->{nodetype}) && $ppcentry->{nodetype} =~ /fsp/) { $cec2fsp->{$ppcentry->{parent}} .= "$ppcentry->{node},"; } } @@ -387,7 +387,7 @@ sub process_request { unless ($ip) { next; } my $real_ip = xCAT::NetworkUtils->getipaddr($ip); unless ($real_ip) { - xCAT::MsgUtils->message("E", {error => ["$node: Cannot get ip for $ip"], errorcode => 1}, $callback); + xCAT::MsgUtils->message("E", {error => ["$node: Cannot get ip for $ip"], errorcode => [1]}, $callback); next; } my %args = ( @@ -653,8 +653,8 @@ sub run_cim $http_params->{timeout} = 5; my ($ret, $value) = xCAT::CIMUtils->enum_instance($http_params, $cimargs); if ($ret->{rc}) { - if ($ret->{msg} =~ /Couldn't connect to server/) { - xCAT::MsgUtils->message("E", data => ["$node: Couldn not connect to server [$http_params->{ip}]."], $callback); + if ($ret->{msg} =~ /(Couldn't connect to server)|(Can't connect to)/) { + xCAT::MsgUtils->message("E", {data => ["$node: Couldn't connect to server [$http_params->{ip}]."]}, $callback); return 10; } else { xCAT::MsgUtils->message("E", {data => ["$node: $ret->{msg}"]}, $callback);