From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 17 Jul 2007 18:38:59 -0000 Subject: [Cluster-devel] cluster/fence/agents/ilo fence_ilo.pl Message-ID: <20070717183859.22892.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: RHEL45 Changes by: rmccabe at sourceware.org 2007-07-17 18:38:59 Modified files: fence/agents/ilo: fence_ilo.pl Log message: Fix for 246246 Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/ilo/fence_ilo.pl.diff?cvsroot=cluster&only_with_tag=RHEL45&r1=1.3.2.3.2.1&r2=1.3.2.3.2.2 --- cluster/fence/agents/ilo/fence_ilo.pl 2007/04/09 15:22:39 1.3.2.3.2.1 +++ cluster/fence/agents/ilo/fence_ilo.pl 2007/07/17 18:38:59 1.3.2.3.2.2 @@ -279,10 +279,13 @@ foreach my $line (@response) { + if ($line =~ /FIRMWARE_VERSION\s*=\s*\"(.*)\"/) { + $firmware_rev = $1; + } if ($line =~ /MANAGEMENT_PROCESSOR\s*=\s*\"(.*)\"/) { if ($1 eq "iLO2") { $ilo_vers = 2; - print "power_status: reporting iLO2\n" if ($verbose); + print "power_status: reporting iLO2 $firmware_rev\n" if ($verbose); } } @@ -358,7 +361,11 @@ # 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"; + if ($firmware_rev > 1.29) { + sendsock $socket, "\n"; + } else { + 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 @@ -515,6 +522,7 @@ $action = "reboot"; $ribcl_vers = undef; # undef = autodetect $ilo_vers = 1; +$firmware_rev = 0; if (@ARGV > 0) { getopts("a:hl:n:o:p:S:r:qvV") || fail_usage ;