Merge pull request #765 from mwhudson/no-live-session-no-error-reports

do not generate a crash report if we are not in a live session
This commit is contained in:
Michael Hudson-Doyle 2020-05-12 22:52:09 +12:00 committed by GitHub
commit 71ee369c7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -161,7 +161,8 @@ class FilesystemController(SubiquityController):
"block probing failed restricted=%s", restricted)
report = self.app.make_apport_report(
kind, "block probing", interrupt=False)
self._crash_reports[restricted] = report
if report is not None:
self._crash_reports[restricted] = report
continue
break

View File

@ -153,7 +153,8 @@ class InstallProgressController(SubiquityController):
self.progress_view.set_status(('info_error',
_("An error has occurred")))
self.start_ui()
self.progress_view.show_error(crash_report)
if crash_report is not None:
self.progress_view.show_error(crash_report)
def logged_command(self, cmd):
return ['systemd-cat', '--level-prefix=false',

View File

@ -274,7 +274,8 @@ class Subiquity(Application):
report = self.make_apport_report(
ErrorReportKind.UI, "Installer UI", interrupt=False,
wait=True)
print("report saved to {}".format(report.path))
if report is not None:
print("report saved to {}".format(report.path))
except Exception:
print("report generation failed")
traceback.print_exc()
@ -457,6 +458,9 @@ class Subiquity(Application):
self._apport_data.append((key, value))
def make_apport_report(self, kind, thing, *, interrupt, wait=False, **kw):
if not self.opts.dry_run and not os.path.exists('/cdrom/.disk/info'):
return None
log.debug("generating crash report")
try: