Merge lp:~qzhang/lava-dispatcher/print-exc-info-v2 into lp:lava-dispatcher

Proposed by Spring Zhang
Status: Merged
Merged at revision: 83
Proposed branch: lp:~qzhang/lava-dispatcher/print-exc-info-v2
Merge into: lp:lava-dispatcher
Diff against target: 107 lines (+11/-11)
4 files modified
lava_dispatcher/__init__.py (+2/-2)
lava_dispatcher/actions/android_deploy.py (+3/-3)
lava_dispatcher/actions/deploy.py (+5/-5)
lava_dispatcher/actions/lava-test.py (+1/-1)
To merge this branch: bzr merge lp:~qzhang/lava-dispatcher/print-exc-info-v2
Reviewer Review Type Date Requested Status
Paul Larson (community) Approve
Review via email: mp+70410@code.launchpad.net

Description of the change

Output exception traceback information to serialIO, so it also goes to logfile.

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

Looks good, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_dispatcher/__init__.py'
2--- lava_dispatcher/__init__.py 2011-07-26 04:55:23 +0000
3+++ lava_dispatcher/__init__.py 2011-08-04 07:37:33 +0000
4@@ -85,8 +85,8 @@
5 err_msg = err_msg + "Lava failed with test: " \
6 + test_name
7 err_msg = err_msg + traceback.format_exc()
8- print >> sys.stderr
9- print >> sys.stderr, err_msg
10+ # output to both serial log and logfile
11+ self.context.client.sio.write(err_msg)
12 else:
13 err_msg = ""
14 self.context.test_data.add_result(cmd['command'],
15
16=== modified file 'lava_dispatcher/actions/android_deploy.py'
17--- lava_dispatcher/actions/android_deploy.py 2011-07-25 09:15:42 +0000
18+++ lava_dispatcher/actions/android_deploy.py 2011-08-04 07:37:33 +0000
19@@ -44,7 +44,7 @@
20 client.wait_network_up()
21 except:
22 tb = traceback.format_exc()
23- print >> sys.stderr, tb
24+ client.sio.write(tb)
25 raise CriticalError("Network can't probe up when deployment")
26
27 try:
28@@ -52,7 +52,7 @@
29 system, data, use_cache)
30 except:
31 tb = traceback.format_exc()
32- print >> sys.stderr, tb
33+ client.sio.write(tb)
34 raise CriticalError("Package can't download when deployment")
35
36 boot_tarball = boot_tbz2.replace(LAVA_IMAGE_TMPDIR, '')
37@@ -72,7 +72,7 @@
38 self.purge_linaro_android_sdcard()
39 except:
40 tb = traceback.format_exc()
41- print >> sys.stderr, tb
42+ client.sio.write(tb)
43 raise CriticalError("Android deployment failed")
44 finally:
45 shutil.rmtree(self.tarball_dir)
46
47=== modified file 'lava_dispatcher/actions/deploy.py'
48--- lava_dispatcher/actions/deploy.py 2011-07-25 09:15:42 +0000
49+++ lava_dispatcher/actions/deploy.py 2011-08-04 07:37:33 +0000
50@@ -46,7 +46,7 @@
51 client.wait_network_up()
52 except:
53 tb = traceback.format_exc()
54- print >> sys.stderr, tb
55+ client.sio.write(tb)
56 raise CriticalError("Network can't probe up when deployment")
57
58 try:
59@@ -54,7 +54,7 @@
60 use_cache)
61 except:
62 tb = traceback.format_exc()
63- print >> sys.stderr, tb
64+ client.sio.write(tb)
65 raise CriticalError("Deployment tarballs preparation failed")
66 boot_tarball = boot_tgz.replace(LAVA_IMAGE_TMPDIR, '')
67 root_tarball = root_tgz.replace(LAVA_IMAGE_TMPDIR, '')
68@@ -67,7 +67,7 @@
69 self.deploy_linaro_bootfs(boot_url)
70 except:
71 tb = traceback.format_exc()
72- print >> sys.stderr, tb
73+ client.sio.write(tb)
74 raise CriticalError("Deployment failed")
75 finally:
76 shutil.rmtree(self.tarball_dir)
77@@ -133,7 +133,7 @@
78 if rc:
79 shutil.rmtree(tarball_dir)
80 tb = traceback.format_exc()
81- print >> sys.stderr, tb
82+ client.sio.write(tb)
83 raise RuntimeError("linaro-media-create failed: %s" % output)
84 boot_offset = self._get_partition_offset(image_file, board.boot_part)
85 root_offset = self._get_partition_offset(image_file, board.root_part)
86@@ -145,7 +145,7 @@
87 except:
88 shutil.rmtree(tarball_dir)
89 tb = traceback.format_exc()
90- print >> sys.stderr, tb
91+ client.sio.write(tb)
92 raise
93 return boot_tgz, root_tgz
94
95
96=== modified file 'lava_dispatcher/actions/lava-test.py'
97--- lava_dispatcher/actions/lava-test.py 2011-07-25 09:15:42 +0000
98+++ lava_dispatcher/actions/lava-test.py 2011-08-04 07:37:33 +0000
99@@ -97,7 +97,7 @@
100 response="list-tests", timeout=10)
101 except:
102 tb = traceback.format_exc()
103- print >> sys.stderr, tb
104+ client.sio.write(tb)
105 raise OperationFailed("lava-test deployment failed")
106
107 for test in tests:

Subscribers

People subscribed via source and target branches