diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 103: more mostly formatting changes to make reviewing the config branch easier

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

Commit Message

Michael-Doyle Hudson Sept. 8, 2011, 10:14 p.m. UTC
------------------------------------------------------------
revno: 103
committer: Michael-Doyle Hudson <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Fri 2011-09-09 10:12:27 +1200
message:
  more mostly formatting changes to make reviewing the config branch easier
modified:
  lava_dispatcher/__init__.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/__init__.py'
--- lava_dispatcher/__init__.py	2011-09-08 04:23:59 +0000
+++ lava_dispatcher/__init__.py	2011-09-08 22:12:27 +0000
@@ -67,29 +67,28 @@ 
                 try:
                     status = 'fail'
                     action.run(**params)
-                except CriticalError, err:
-                    raise err
-                except (pexpect.TIMEOUT, GeneralError), err:
+                except CriticalError as err:
+                    raise
+                except (pexpect.TIMEOUT, GeneralError) as err:
                     pass
-                except Exception, err:
+                except Exception as err:
                     raise
                 else:
                     status = 'pass'
                 finally:
                     if status == 'fail':
-                        err_msg = "Lava failed at action " + cmd['command'] \
-                            + " with error: " + str(err) + "\n"
+                        err_msg = "Lava failed at action %s with error: %s\n" %\
+                                  (cmd['command'], err)
                         if cmd['command'] == 'lava_test_run':
-                            test_name = params.get('test_name', "Unknown")
-                            err_msg = err_msg + "Lava failed with test: " \
-                                + test_name
+                            err_msg += "Lava failed on test: %s" %\
+                                       params.get('test_name', "Unknown")
                         err_msg = err_msg + traceback.format_exc()
                         # output to both serial log and logfile
                         self.context.client.sio.write(err_msg)
                     else:
                         err_msg = ""
-                    self.context.test_data.add_result(cmd['command'], 
-                        status, err_msg)
+                    self.context.test_data.add_result(
+                        cmd['command'], status, err_msg)
         except:
             #Capture all user-defined and non-user-defined critical errors
             self.context.test_data.job_status='fail'