[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 673: Fix Android image error messaging

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

Commit Message

Tyler Baker Sept. 5, 2013, 11:59 p.m.
Merge authors:
  Tyler Baker (tyler-baker)
Related merge proposals:
  https://code.launchpad.net/~tyler-baker/lava-dispatcher/fix-android-error-messages/+merge/183998
  proposed by: Tyler Baker (tyler-baker)
  review: Approve - Antonio Terceiro (terceiro)
------------------------------------------------------------
revno: 673 [merge]
committer: Tyler Baker <tyler.baker@linaro.org>
branch nick: lava-dispatcher
timestamp: Thu 2013-09-05 16:58:28 -0700
message:
  Fix Android image error messaging
modified:
  lava_dispatcher/client/base.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-09-03 15:16:49 +0000
+++ lava_dispatcher/client/base.py	2013-09-05 00:10:08 +0000
@@ -30,7 +30,6 @@ 
 import lava_dispatcher.utils as utils
 
 from lava_dispatcher.errors import (
-    GeneralError,
     NetworkError,
     OperationFailed,
     CriticalError,
@@ -330,7 +329,9 @@ 
                      response=[activity_pat],
                      timeout=timeout, wait_prompt=False)
         except pexpect.TIMEOUT:
-            raise GeneralError('The home screen has not displayed')
+            msg = "The home screen was not displayed"
+            logging.critical(msg)
+            raise CriticalError(msg)
         finally:
             #send ctrl+c to exit the logcat command,
             #and make the latter command can be run on the normal
@@ -513,7 +514,7 @@ 
         in_linaro_android_image = False
 
         while (attempts < boot_attempts) and (not in_linaro_android_image):
-            logging.info("Booting the android test image. Attempt: %d" %
+            logging.info("Booting the Android test image. Attempt: %d" %
                          (attempts + 1))
             TESTER_PS1_PATTERN = self.target_device.deployment_data[
                 'TESTER_PS1_PATTERN']
@@ -522,7 +523,7 @@ 
             try:
                 self._boot_linaro_android_image()
             except (OperationFailed, pexpect.TIMEOUT) as e:
-                msg = "Failed to boot Linaro Android Image: %s" % e
+                msg = "Failed to boot the Android test image: %s" % e
                 logging.info(msg)
                 attempts += 1
                 continue
@@ -577,7 +578,9 @@ 
             in_linaro_android_image = True
 
         if not in_linaro_android_image:
-            raise OperationFailed("booting into android test image failed")
+            msg = "Could not get the Android test image booted properly"
+            logging.critical(msg)
+            raise CriticalError(msg)
 
         #check if the adb connection can be created.
         #by adb connect dev_ip command