← Back to team overview

apport-hackers team mailing list archive

[Merge] lp:~brian-murray/apport/bug-1084979 into lp:apport

 

Brian Murray has proposed merging lp:~brian-murray/apport/bug-1084979 into lp:apport.

Requested reviews:
  Apport upstream developers (apport-hackers)

For more details, see:
https://code.launchpad.net/~brian-murray/apport/bug-1084979/+merge/248685

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.
-- 
Your team Apport upstream developers is requested to review the proposed merge of lp:~brian-murray/apport/bug-1084979 into lp:apport.
=== modified file 'apport/ui.py'
--- apport/ui.py	2014-12-19 06:43:26 +0000
+++ apport/ui.py	2015-02-04 22:27:51 +0000
@@ -995,8 +995,12 @@
             # since this might take a while, create separate threads and
             # display a progress dialog.
             self.ui_start_info_collection_progress()
-
-            hookui = HookUI(self)
+            # only use a UI for asking questions if the crash db will accept
+            # the report
+            if self.crashdb.accepts(self.report):
+                hookui = HookUI(self)
+            else:
+                hookui = None
 
             if 'Stacktrace' not in self.report:
                 # save original environment, in case hooks change it
@@ -1008,10 +1012,11 @@
                 icthread.start()
                 while icthread.isAlive():
                     self.ui_pulse_info_collection_progress()
-                    try:
-                        hookui.process_event()
-                    except KeyboardInterrupt:
-                        sys.exit(1)
+                    if hookui:
+                        try:
+                            hookui.process_event()
+                        except KeyboardInterrupt:
+                            sys.exit(1)
 
                 icthread.join()