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
=== modified file 'lava_dispatcher/__init__.py'
--- lava_dispatcher/__init__.py 2011-07-26 04:55:23 +0000
+++ lava_dispatcher/__init__.py 2011-08-04 07:37:33 +0000
@@ -85,8 +85,8 @@
85 err_msg = err_msg + "Lava failed with test: " \85 err_msg = err_msg + "Lava failed with test: " \
86 + test_name86 + test_name
87 err_msg = err_msg + traceback.format_exc()87 err_msg = err_msg + traceback.format_exc()
88 print >> sys.stderr88 # output to both serial log and logfile
89 print >> sys.stderr, err_msg89 self.context.client.sio.write(err_msg)
90 else:90 else:
91 err_msg = ""91 err_msg = ""
92 self.context.test_data.add_result(cmd['command'], 92 self.context.test_data.add_result(cmd['command'],
9393
=== modified file 'lava_dispatcher/actions/android_deploy.py'
--- lava_dispatcher/actions/android_deploy.py 2011-07-25 09:15:42 +0000
+++ lava_dispatcher/actions/android_deploy.py 2011-08-04 07:37:33 +0000
@@ -44,7 +44,7 @@
44 client.wait_network_up()44 client.wait_network_up()
45 except:45 except:
46 tb = traceback.format_exc()46 tb = traceback.format_exc()
47 print >> sys.stderr, tb47 client.sio.write(tb)
48 raise CriticalError("Network can't probe up when deployment")48 raise CriticalError("Network can't probe up when deployment")
4949
50 try:50 try:
@@ -52,7 +52,7 @@
52 system, data, use_cache)52 system, data, use_cache)
53 except:53 except:
54 tb = traceback.format_exc()54 tb = traceback.format_exc()
55 print >> sys.stderr, tb55 client.sio.write(tb)
56 raise CriticalError("Package can't download when deployment")56 raise CriticalError("Package can't download when deployment")
5757
58 boot_tarball = boot_tbz2.replace(LAVA_IMAGE_TMPDIR, '')58 boot_tarball = boot_tbz2.replace(LAVA_IMAGE_TMPDIR, '')
@@ -72,7 +72,7 @@
72 self.purge_linaro_android_sdcard()72 self.purge_linaro_android_sdcard()
73 except:73 except:
74 tb = traceback.format_exc()74 tb = traceback.format_exc()
75 print >> sys.stderr, tb75 client.sio.write(tb)
76 raise CriticalError("Android deployment failed")76 raise CriticalError("Android deployment failed")
77 finally:77 finally:
78 shutil.rmtree(self.tarball_dir)78 shutil.rmtree(self.tarball_dir)
7979
=== modified file 'lava_dispatcher/actions/deploy.py'
--- lava_dispatcher/actions/deploy.py 2011-07-25 09:15:42 +0000
+++ lava_dispatcher/actions/deploy.py 2011-08-04 07:37:33 +0000
@@ -46,7 +46,7 @@
46 client.wait_network_up()46 client.wait_network_up()
47 except:47 except:
48 tb = traceback.format_exc()48 tb = traceback.format_exc()
49 print >> sys.stderr, tb49 client.sio.write(tb)
50 raise CriticalError("Network can't probe up when deployment")50 raise CriticalError("Network can't probe up when deployment")
5151
52 try:52 try:
@@ -54,7 +54,7 @@
54 use_cache)54 use_cache)
55 except:55 except:
56 tb = traceback.format_exc()56 tb = traceback.format_exc()
57 print >> sys.stderr, tb57 client.sio.write(tb)
58 raise CriticalError("Deployment tarballs preparation failed")58 raise CriticalError("Deployment tarballs preparation failed")
59 boot_tarball = boot_tgz.replace(LAVA_IMAGE_TMPDIR, '')59 boot_tarball = boot_tgz.replace(LAVA_IMAGE_TMPDIR, '')
60 root_tarball = root_tgz.replace(LAVA_IMAGE_TMPDIR, '')60 root_tarball = root_tgz.replace(LAVA_IMAGE_TMPDIR, '')
@@ -67,7 +67,7 @@
67 self.deploy_linaro_bootfs(boot_url)67 self.deploy_linaro_bootfs(boot_url)
68 except:68 except:
69 tb = traceback.format_exc()69 tb = traceback.format_exc()
70 print >> sys.stderr, tb70 client.sio.write(tb)
71 raise CriticalError("Deployment failed")71 raise CriticalError("Deployment failed")
72 finally:72 finally:
73 shutil.rmtree(self.tarball_dir)73 shutil.rmtree(self.tarball_dir)
@@ -133,7 +133,7 @@
133 if rc:133 if rc:
134 shutil.rmtree(tarball_dir)134 shutil.rmtree(tarball_dir)
135 tb = traceback.format_exc()135 tb = traceback.format_exc()
136 print >> sys.stderr, tb136 client.sio.write(tb)
137 raise RuntimeError("linaro-media-create failed: %s" % output)137 raise RuntimeError("linaro-media-create failed: %s" % output)
138 boot_offset = self._get_partition_offset(image_file, board.boot_part)138 boot_offset = self._get_partition_offset(image_file, board.boot_part)
139 root_offset = self._get_partition_offset(image_file, board.root_part)139 root_offset = self._get_partition_offset(image_file, board.root_part)
@@ -145,7 +145,7 @@
145 except:145 except:
146 shutil.rmtree(tarball_dir)146 shutil.rmtree(tarball_dir)
147 tb = traceback.format_exc()147 tb = traceback.format_exc()
148 print >> sys.stderr, tb148 client.sio.write(tb)
149 raise149 raise
150 return boot_tgz, root_tgz150 return boot_tgz, root_tgz
151151
152152
=== modified file 'lava_dispatcher/actions/lava-test.py'
--- lava_dispatcher/actions/lava-test.py 2011-07-25 09:15:42 +0000
+++ lava_dispatcher/actions/lava-test.py 2011-08-04 07:37:33 +0000
@@ -97,7 +97,7 @@
97 response="list-tests", timeout=10)97 response="list-tests", timeout=10)
98 except:98 except:
99 tb = traceback.format_exc()99 tb = traceback.format_exc()
100 print >> sys.stderr, tb100 client.sio.write(tb)
101 raise OperationFailed("lava-test deployment failed")101 raise OperationFailed("lava-test deployment failed")
102102
103 for test in tests:103 for test in tests:

Subscribers

People subscribed via source and target branches