[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 605: Fix bug in concatinating str and int in deploy_linaro_image attempts.

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

Commit Message

Senthil Kumaran May 20, 2013, 6:39 a.m.
------------------------------------------------------------
revno: 605
committer: Senthil Kumaran <senthil.kumaran@linaro.org>
branch nick: trunk
timestamp: Mon 2013-05-20 12:07:29 +0530
message:
  Fix bug in concatinating str and int in deploy_linaro_image attempts.
modified:
  lava_dispatcher/client/base.py
  lava_dispatcher/device/master.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

Patch

=== modified file 'lava_dispatcher/client/base.py'
--- lava_dispatcher/client/base.py	2013-05-15 23:15:31 +0000
+++ lava_dispatcher/client/base.py	2013-05-20 06:37:29 +0000
@@ -426,7 +426,11 @@ 
         attempts = 0
         in_linaro_image = False
         while (attempts < boot_attempts) and (not in_linaro_image):
-            logging.info("Booting the test image. Attempt: %d" % attempts + 1)
+            logging.info("Booting the test image. Attempt: %d" % (attempts + 1))
+            timeout = self.config.boot_linaro_timeout
+            TESTER_PS1_PATTERN = self.target_device.deployment_data[
+                'TESTER_PS1_PATTERN']
+
             try:
                 self._boot_linaro_image()
             except (OperationFailed, pexpect.TIMEOUT) as e:
@@ -435,8 +439,6 @@ 
                 attempts += 1
                 continue
 
-                timeout = self.config.boot_linaro_timeout
-                TESTER_PS1_PATTERN = self.target_device.deployment_data['TESTER_PS1_PATTERN']
             try:
                 wait_for_prompt(self.proc, TESTER_PS1_PATTERN, timeout=timeout)
             except (pexpect.TIMEOUT) as e:

=== modified file 'lava_dispatcher/device/master.py'
--- lava_dispatcher/device/master.py	2013-05-13 11:20:17 +0000
+++ lava_dispatcher/device/master.py	2013-05-20 06:37:29 +0000
@@ -398,7 +398,8 @@ 
         attempts = 0
         in_master_image = False
         while (attempts < boot_attempts) and (not in_master_image):
-            logging.info("Booting the system master image. Attempt: %d" % attempts + 1)
+            logging.info("Booting the system master image. Attempt: %d" %
+                         (attempts + 1))
             try:
                 self._soft_reboot()
                 self._wait_for_master_boot()