From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 9 Apr 2007 15:20:09 -0000 Subject: [Cluster-devel] cluster/fence/agents/ilo fence_ilo.pl Message-ID: <20070409152009.16916.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: cluster Branch: RHEL50 Changes by: rmccabe at sourceware.org 2007-04-09 16:20:09 Modified files: fence/agents/ilo: fence_ilo.pl Log message: Fix for bz235271: Regression in fence_ilo Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/ilo/fence_ilo.pl.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.5&r2=1.5.4.1 --- cluster/fence/agents/ilo/fence_ilo.pl 2006/08/16 19:11:49 1.5 +++ cluster/fence/agents/ilo/fence_ilo.pl 2007/04/09 15:20:09 1.5.4.1 @@ -262,6 +262,13 @@ foreach my $line (@response) { + if ($line =~ /MANAGEMENT_PROCESSOR\s*=\s*\"(.*)\"/) { + if ($1 eq "iLO2") { + $ilo_vers = 2; + print "power_status: reporting iLO2\n" if ($verbose); + } + } + if ($line =~ /MESSAGE='(.*)'/) { my $msg = $1; @@ -326,10 +333,20 @@ sendsock $socket, "\n"; sendsock $socket, "\n"; + if ($ilo_vers == 2) { + # iLO2 with RIBCL v2.22 behaves differently from + # iLO with RIBCL v2.22. For the former, HOLD_PWR_BTN is + # used to both power the machine on and off; when the power + # is off, PRESS_PWR_BUTTON has no effect. For the latter, + # HOLD_PWR_BUTTON is used to power the machine off, and + # PRESS_PWR_BUTTON is used to power the machine on; + # when the power is off, HOLD_PWR_BUTTON has no effect. + sendsock $socket, "\n"; + } # As of firmware version 1.71 (RIBCL 2.21) The SET_HOST_POWER command # is no longer available. HOLD_PWR_BTN and PRESS_PWR_BTN are used # instead now :( - if ($ribcl_vers < 2.21 ) + elsif ($ribcl_vers < 2.21) { sendsock $socket, "\n"; } @@ -384,6 +401,9 @@ sendsock $socket, "\n"; } sendsock $socket, "\n"; + if ($ribcl_vers >= 2) { + sendsock $socket, "\n"; + } sendsock $socket, "\n"; sendsock $socket, "\n"; sendsock $socket, "\n"; @@ -469,6 +489,7 @@ $action = "reboot"; $ribcl_vers = undef; # undef = autodetect +$ilo_vers = 1; if (@ARGV > 0) { getopts("a:hl:n:o:p:r:qvV") || fail_usage ;