Merge lp:~pwlars/lava-test/lp660538 into lp:lava-test/0.0

Proposed by Paul Larson
Status: Merged
Merged at revision: 47
Proposed branch: lp:~pwlars/lava-test/lp660538
Merge into: lp:lava-test/0.0
Diff against target: 31 lines (+8/-2)
2 files modified
abrek/dashboard.py (+4/-1)
abrek/results.py (+4/-1)
To merge this branch: bzr merge lp:~pwlars/lava-test/lp660538
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+38540@code.launchpad.net

Description of the change

Silence the IOError that gets generated when you pipe output to less and quit before it's complete

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'abrek/dashboard.py'
2--- abrek/dashboard.py 2010-10-11 23:05:37 +0000
3+++ abrek/dashboard.py 2010-10-15 14:31:07 +0000
4@@ -172,7 +172,10 @@
5 print "You must specify a result"
6 sys.exit(1)
7 bundle = generate_bundle(self.args[0])
8- print json.dumps(bundle, indent=2)
9+ try:
10+ print json.dumps(bundle, indent=2)
11+ except IOError:
12+ pass
13
14
15 def generate_bundle(result):
16
17=== modified file 'abrek/results.py'
18--- abrek/results.py 2010-10-11 23:07:10 +0000
19+++ abrek/results.py 2010-10-15 14:31:07 +0000
20@@ -57,7 +57,10 @@
21 if not os.path.exists(testoutput):
22 print "No result found for '%s'" % self.args[0]
23 sys.exit(1)
24- print(read_file(testoutput))
25+ try:
26+ print(read_file(testoutput))
27+ except IOError:
28+ pass
29
30
31 class cmd_remove(AbrekCmd):

Subscribers

People subscribed via source and target branches