[Oar-commits] r2710 - trunk/Tools

bzizou at users.gforge.inria.fr bzizou at users.gforge.inria.fr
Wed Mar 31 22:39:25 CEST 2010


Author: bzizou
Date: 2010-03-31 22:39:24 +0200 (Wed, 31 Mar 2010)
New Revision: 2710

Modified:
   trunk/Tools/oarphoenix.pl
Log:
Bugfix: empty values in the hash

Modified: trunk/Tools/oarphoenix.pl
===================================================================
--- trunk/Tools/oarphoenix.pl	2010-03-31 15:42:02 UTC (rev 2709)
+++ trunk/Tools/oarphoenix.pl	2010-03-31 20:39:24 UTC (rev 2710)
@@ -33,7 +33,7 @@
 my $SOFT_TIMEOUT=300;
 
 # Command sent to rebopot a node (seond attempt)
-my $HARD_REBOOTCMD="ipmitool -U USERID -P PASSW0RD -H {NODENAME}-mgt power cycle";
+my $HARD_REBOOTCMD="ipmitool -U USERID -P PASSW0RD -H {NODENAME}-mgt power off;ipmitool -U USERID -P PASSW0RD -H {NODENAME}-mgt power on";
 
 # Timeout (s) for a hard rebooted node to be considered really broken, then
 # an email is sent
@@ -41,10 +41,10 @@
 my $HARD_TIMEOUT=300;
 
 # Max number of simultaneous reboots (soft OR hard)
-my $MAX_REBOOTS=5;
+my $MAX_REBOOTS=10;
 
 # Timout (s) for unix commands
-my $CMD_TIMEOUT=10;
+my $CMD_TIMEOUT=15;
 
 # Get the broken nodes list (SQL request to customize)
 my $base = iolib::connect();
@@ -136,12 +136,14 @@
   my $nodes;
   my $c=0;
   foreach my $node (@broken_nodes) {
-    if (defined($db->{$node}->{"soft_reboot"})) {
-      if (time() > $db->{$node}->{"soft_reboot"} + $SOFT_TIMEOUT) {
-        $c++;
-        push (@$nodes,$node);
+    if (defined($db->{$node})) {
+      if (defined($db->{$node}->{"soft_reboot"})) {
+        if (time() > $db->{$node}->{"soft_reboot"} + $SOFT_TIMEOUT) {
+          $c++;
+          push (@$nodes,$node);
+        }
+        last if ($c>=$MAX_REBOOTS);
       }
-      last if ($c>=$MAX_REBOOTS);
     }
   }
   return $nodes;




More information about the Oar-commits mailing list