From e72f22bac65ed67849d8df28b7119c76df077c67 Mon Sep 17 00:00:00 2001 From: rpm-build Date: Thu, 22 Aug 2024 12:14:53 +0200 Subject: [PATCH] Disable bug reporting, if libreport is not available libreport doesn't support JIRA, so it won't be in RHEL. Resolves: RHEL-52902 Signed-off-by: Michal Srb --- src/setroubleshoot/browser.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/setroubleshoot/browser.py b/src/setroubleshoot/browser.py index c98b075..33272db 100644 --- a/src/setroubleshoot/browser.py +++ b/src/setroubleshoot/browser.py @@ -64,10 +64,17 @@ from setroubleshoot.util import * from setroubleshoot.html_util import html_to_text import re import dbus -import report -import report.io -import report.io.GTKIO -import report.accountmanager + +has_libreport = False +try: + import report + import report.io + import report.io.GTKIO + import report.accountmanager + has_libreport = True +except ImportError: + # Bug reporting won't be available + pass from gi.repository import Gio @@ -278,7 +285,8 @@ class BrowserApplet: self.make_treeview() self.troubleshoot_visible = False self.current_alert = -1 - self.accounts = report.accountmanager.AccountManager() + if has_libreport: + self.accounts = report.accountmanager.AccountManager() def get_current_alert(self): try: @@ -541,7 +549,7 @@ class BrowserApplet: report_button.connect("clicked", self.fix_bug, alert.local_id, plugin.analysis_id) vbox.add(report_button) - elif plugin.report_bug: + elif plugin.report_bug and has_libreport: report_button = Gtk.Button() report_button.set_label(_("Report\nBug")) report_button.show() -- 2.46.0