diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 178: It seems sometimes, on snowball, we don't get all of the reboot message before losing serial. De...

Message ID 20111209210313.31893.68703.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Paul Larson Dec. 9, 2011, 9:03 p.m. UTC
------------------------------------------------------------
revno: 178
committer: Paul Larson <paul.larson@canonical.com>
branch nick: lava-dispatcher
timestamp: Fri 2011-12-09 15:00:57 -0600
message:
  It seems sometimes, on snowball, we don't get all of the reboot message before losing serial.  Detect something slightly earlier
modified:
  lava_dispatcher/connection.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/connection.py'
--- lava_dispatcher/connection.py	2011-12-06 20:54:58 +0000
+++ lava_dispatcher/connection.py	2011-12-09 21:00:57 +0000
@@ -19,10 +19,8 @@ 
 # with this program; if not, see <http://www.gnu.org/licenses>.
 
 import logging
+import pexpect
 import re
-import time
-
-import pexpect
 
 
 class LavaConnection(object):
@@ -69,8 +67,8 @@ 
         logging.info("Rebooting the system")
         id = self.proc.expect(
             ['Restarting system.', 'The system is going down for reboot NOW',
-                pexpect.TIMEOUT], timeout=120)
-        if id not in [0,1]:
+                'Will now restart', pexpect.TIMEOUT], timeout=120)
+        if id not in [0,1,2]:
             self.hard_reboot()
 
     def hard_reboot(self):
@@ -90,7 +88,7 @@ 
         logging.info("Perform hard reset on the system")
         self.proc.send("~$")
         self.proc.sendline("hardreset")
-		
+
     def _boot(self, boot_cmds):
         self.soft_reboot()
         try: