Merge lp:~gothicx/apport/failure_key_error into lp:~apport-hackers/apport/trunk

Proposed by Marco Rodrigues
Status: Rejected
Rejected by: Martin Pitt
Proposed branch: lp:~gothicx/apport/failure_key_error
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: None lines
To merge this branch: bzr merge lp:~gothicx/apport/failure_key_error
Reviewer Review Type Date Requested Status
Martin Pitt (community) Needs Fixing
Review via email: mp+11274@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

This looks like it desperately tries to make apportcheckresume create a report if you just call it without any arguments and manually.

apportcheckresume isn't meant to be used like that, it's called from pm-utils on failure, which will provide the data it needs.

I'm fine with fixing the exception in favor of printing a "don't call me" error message, but it shouldn't produce a report which people could send, since it would be meaningless and just clutter the bug database.

Thanks, Martin

review: Needs Fixing

Unmerged revisions

1573. By Marco Rodrigues

Check if key Failure exist before add it to Tags

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/apportcheckresume'
2--- bin/apportcheckresume 2009-04-30 13:41:03 +0000
3+++ bin/apportcheckresume 2009-09-06 16:43:37 +0000
4@@ -42,10 +42,12 @@
5 apport.hookutils.attach_file_if_exists(pr, stresslog, 'StressLog')
6
7 # Ensure we are appropriatly tagged.
8- pr['Tags'] = 'resume ' + pr['Failure']
9+ if pr.has_key('Failure'):
10+ pr['Tags'] = 'resume ' + pr['Failure']
11
12 # Record the failure mode.
13- pr['Failure'] += '/resume'
14+ if pr.has_key('Failure'):
15+ pr['Failure'] += '/resume'
16
17 # If we had a late hang pull in the resume-hang logfile. Also
18 # add an additional tag so we can pick these out.
19@@ -54,7 +56,7 @@
20 pr['Tags'] += ' resume-late-hang'
21
22 # Generate a sensible report message.
23- if pr['Failure'] == 'suspend/resume':
24+ if pr.has_key('Failure') and pr['Failure'] == 'suspend/resume':
25 pr['Annotation'] = _('This occured during a previous suspend and prevented it from resuming properly.')
26 else:
27 pr['Annotation'] = _('This occured during a previous hibernate and prevented it from resuming properly.')
28@@ -62,7 +64,9 @@
29 # If we had a late hang make sure the dialog is clear that they may
30 # not have noticed. Also update the bug title so we notice.
31 if os.path.exists(hanglog):
32- pr['Annotation'] += ' ' + _("The resume processing hung very near the end and will have appeared to have completed normally.")
33+ pr['Annotation'] += ' ' + _('The resume processing hung very near the end and will have appeared to have completed normally.')
34+
35+ if pr.has_key('Failure'):
36 pr['Failure'] = 'late resume'
37
38 if pr.check_ignored():
39@@ -83,5 +87,3 @@
40
41 if __name__ == "__main__":
42 sys.exit(main())
43-
44-

Subscribers

People subscribed via source and target branches