Merge lp:~brian-murray/apport/bug-1084979 into lp:~apport-hackers/apport/trunk

Proposed by Brian Murray
Status: Merged
Merged at revision: 2895
Proposed branch: lp:~brian-murray/apport/bug-1084979
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: 33 lines (+11/-6)
1 file modified
apport/ui.py (+11/-6)
To merge this branch: bzr merge lp:~brian-murray/apport/bug-1084979
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+248685@code.launchpad.net

Description of the change

This sets hookui to None if the crashdb does not accept the report type. For Ubuntu stable releases this means that when problem_types is set to ['Bug', 'Package'] in /etc/apport/crashdb.conf, hooks will not ask questions of the user for the ProblemType = Crash. This will end up resolving bug 1084979.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

LGTM, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'apport/ui.py'
2--- apport/ui.py 2014-12-19 06:43:26 +0000
3+++ apport/ui.py 2015-02-04 22:27:51 +0000
4@@ -995,8 +995,12 @@
5 # since this might take a while, create separate threads and
6 # display a progress dialog.
7 self.ui_start_info_collection_progress()
8-
9- hookui = HookUI(self)
10+ # only use a UI for asking questions if the crash db will accept
11+ # the report
12+ if self.crashdb.accepts(self.report):
13+ hookui = HookUI(self)
14+ else:
15+ hookui = None
16
17 if 'Stacktrace' not in self.report:
18 # save original environment, in case hooks change it
19@@ -1008,10 +1012,11 @@
20 icthread.start()
21 while icthread.isAlive():
22 self.ui_pulse_info_collection_progress()
23- try:
24- hookui.process_event()
25- except KeyboardInterrupt:
26- sys.exit(1)
27+ if hookui:
28+ try:
29+ hookui.process_event()
30+ except KeyboardInterrupt:
31+ sys.exit(1)
32
33 icthread.join()
34

Subscribers

People subscribed via source and target branches