From b0eefd4e7b2e28c22e5cfcd784b1099335b0a253 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Sun, 6 Jan 2013 08:38:34 +0000 Subject: [PATCH] fix bug 3273:xcat returns ipmi plugin bug if console opening failed for system x git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14763 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/ipmi.pm | 4 ++++ xCAT-server/share/xcat/cons/ipmi | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index bad32fab5..b746ba7c5 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -5918,6 +5918,10 @@ sub getipmicons { $ipmicons->{node}->[0]->{bmcuser}->[0]=$argr->[2]; $ipmicons->{node}->[0]->{bmcpass}->[0]=$argr->[3]; my $ipmisess = xCAT::IPMI->new(bmc=>$argr->[1],userid=>$argr->[2],password=>$argr->[3]); + if ($ipmisess->{error}) { + xCAT::SvrUtils::sendmsg([1,$ipmisess->{error}],$cb,$argr->[0],%allerrornodes); + return; + } $ipmisess->{ipmicons} = $ipmicons; $ipmisess->{cb} = $cb; $ipmisess->subcmd(netfn=>0x6,command=>0x38,data=>[0x0e,0x04],callback=>\&got_channel_auth_cap_foripmicons,callback_args=>$ipmisess); diff --git a/xCAT-server/share/xcat/cons/ipmi b/xCAT-server/share/xcat/cons/ipmi index a9b23096a..aef116ee6 100755 --- a/xCAT-server/share/xcat/cons/ipmi +++ b/xCAT-server/share/xcat/cons/ipmi @@ -48,6 +48,10 @@ sub getans { $bmc = $rsp->{node}->[0]->{bmcaddr}->[0]; $username = $rsp->{node}->[0]->{bmcuser}->[0]; $password = $rsp->{node}->[0]->{bmcpass}->[0]; + if (exists $rsp->{node}->[0]->{error}) { + my $error = $rsp->{node}->[0]->{error}->[0]; + print $error."\n"; + } } } my $cmdref={