Per the discussion with GSS people, this change makes "abrt-cli report DIR"
to show this choice of reporters:
How would you like to report the problem?
1) New Red Hat Support case
2) Existing Red Hat Support case
3) Save to tar archive
Choice (2) is similar to (1) but in addition it prompts: "Case number:"
Signed-off-by: Denys Vlasenko <dvlasenk(a)redhat.com>
---
po/POTFILES.in | 2 +
src/gui-wizard-gtk/wizard.c | 8 +++---
src/plugins/Makefile.am | 5 ++++
src/plugins/bugzilla_event.conf | 3 +-
src/plugins/mailx_event.conf | 6 +++-
src/plugins/print_event.conf | 5 ++-
src/plugins/report_RHTSupport.xml.in | 4 +-
src/plugins/report_RHTSupportAttach.xml.in | 36 ++++++++++++++++++++++++++++
src/plugins/report_Tarball.xml.in | 12 +++++++++
src/plugins/reporter-rhtsupport.c | 36 +++++++++++++++++++++++----
src/plugins/rhtsupport_event.conf | 9 ++++++-
src/plugins/tarball_event.conf | 4 +++
src/plugins/uploader_event.conf | 3 +-
13 files changed, 114 insertions(+), 19 deletions(-)
create mode 100644 src/plugins/report_RHTSupportAttach.xml.in
create mode 100644 src/plugins/report_Tarball.xml.in
create mode 100644 src/plugins/tarball_event.conf
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 353b67c..b4e84fd 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -24,6 +24,8 @@ src/plugins/report_Kerneloops.xml.in
src/plugins/report_Logger.xml.in
src/plugins/report_Mailx.xml.in
src/plugins/report_RHTSupport.xml.in
+src/plugins/report_RHTSupportAttach.xml.in
+src/plugins/report_Tarball.xml.in
src/plugins/report_Uploader.xml.in
src/plugins/reporter-bugzilla.c
src/plugins/reporter-kerneloops.c
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index 425c1c7..c24ca8c 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -910,7 +910,7 @@ static event_gui_data_t *add_event_buttons(GtkBox *box,
if (get_problem_data_item_or_NULL(g_cd, cfg->ec_creates_items))
{
green_choice = true;
- event_description = tmp_description = xasprintf(_("(not needed,
'%s' already exists)"), cfg->ec_creates_items);
+ tmp_description = xasprintf(_("(not needed, '%s' already
exists)"), cfg->ec_creates_items);
}
}
}
@@ -919,9 +919,9 @@ static event_gui_data_t *add_event_buttons(GtkBox *box,
//VERB2 log("adding button '%s' to box %p", event_name, box);
char *event_label = xasprintf("%s%s%s",
- event_screen_name,
- (event_description ? " - " : ""),
- event_description ? event_description : ""
+ event_description ? event_description : event_screen_name,
+ tmp_description ? " - " : "",
+ tmp_description ? tmp_description : ""
);
free(tmp_description);
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 0284b3c..a92cb49 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -27,7 +27,9 @@ dist_events_DATA = \
report_Logger.xml \
report_Mailx.xml \
report_RHTSupport.xml \
+ report_RHTSupportAttach.xml \
report_Kerneloops.xml \
+ report_Tarball.xml \
report_Uploader.xml
@INTLTOOL_XML_RULE@
@@ -39,6 +41,7 @@ dist_eventsconf_DATA = \
print_event.conf \
bugzilla_event.conf \
rhtsupport_event.conf \
+ tarball_event.conf \
uploader_event.conf
EXTRA_DIST = \
@@ -48,7 +51,9 @@ EXTRA_DIST = \
report_Logger.xml.in \
report_Mailx.xml.in \
report_RHTSupport.xml.in \
+ report_RHTSupportAttach.xml.in \
report_Kerneloops.xml.in \
+ report_Tarball.xml.in \
report_Uploader.xml.in
$(DESTDIR)/$(DEBUG_INFO_DIR):
diff --git a/src/plugins/bugzilla_event.conf b/src/plugins/bugzilla_event.conf
index 109c581..828da94 100644
--- a/src/plugins/bugzilla_event.conf
+++ b/src/plugins/bugzilla_event.conf
@@ -1 +1,2 @@
-EVENT=report_Bugzilla analyzer=libreport reporter-bugzilla -b
+EVENT=report_Bugzilla analyzer=libreport
+ reporter-bugzilla -b
diff --git a/src/plugins/mailx_event.conf b/src/plugins/mailx_event.conf
index e03bb96..f3176bd 100644
--- a/src/plugins/mailx_event.conf
+++ b/src/plugins/mailx_event.conf
@@ -1,6 +1,8 @@
# This is already enabled in abrt_event.conf
-#EVENT=post-create reporter-mailx --notify-only -c /etc/libreport/plugins/mailx.conf
+#EVENT=post-create
+ reporter-mailx --notify-only -c /etc/libreport/plugins/mailx.conf
# Users should user rhtsupport plugin, so disabling others by default
# to not confuse users with too many options
-#EVENT=report_Mailx reporter-mailx
+#EVENT=report_Mailx
+ reporter-mailx
diff --git a/src/plugins/print_event.conf b/src/plugins/print_event.conf
index 6e6e38e..5514c55 100644
--- a/src/plugins/print_event.conf
+++ b/src/plugins/print_event.conf
@@ -1,2 +1,3 @@
-EVENT=report_Logger
- reporter-print -o "${Logger_Log_File:-/tmp/abrt.log}" -a
"${Logger_Append:-no}" -r
+# Yet another example
+#EVENT=report_Logger
+ reporter-print -o "${Logger_Log_File:-/tmp/abrt.log}" -a
"${Logger_Append:-no}" -r
diff --git a/src/plugins/report_RHTSupport.xml.in b/src/plugins/report_RHTSupport.xml.in
index d1993f0..db01d14 100644
--- a/src/plugins/report_RHTSupport.xml.in
+++ b/src/plugins/report_RHTSupport.xml.in
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<event>
- <_name>Red Hat Customer Support</_name>
- <_description>Report to Red Hat support</_description>
+ <_name>New Red Hat Support case</_name>
+ <_description>Create new Red Hat Support case</_description>
<requires-items>package</requires-items>
<exclude-items-by-default>count,event_log,reported_to,vmcore</exclude-items-by-default>
diff --git a/src/plugins/report_RHTSupportAttach.xml.in
b/src/plugins/report_RHTSupportAttach.xml.in
new file mode 100644
index 0000000..d46e107
--- /dev/null
+++ b/src/plugins/report_RHTSupportAttach.xml.in
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<event>
+ <_name>Existing Red Hat Support case</_name>
+ <_description>Add to existing Red Hat Support case</_description>
+
+ <requires-items>package</requires-items>
+
<exclude-items-by-default>count,event_log,reported_to,vmcore</exclude-items-by-default>
+ <exclude-items-always></exclude-items-always>
+ <exclude-binary-items>no</exclude-binary-items>
+ <include-items-by-default></include-items-by-default>
+ <minimal-rating>0</minimal-rating>
+
+ <options>
+ <option type="text" name="RHTSupport_URL">
+ <_label>RH Portal URL</_label>
+ <allow-empty>no</allow-empty>
+ <_description>Address of the Red Hat support
portal</_description>
+ <
default-value>https://api.access.redhat.com/rs</default-value>
+ </option>
+ <option type="text" name="RHTSupport_Login">
+ <_label>Username</_label>
+ <_description>Red Hat customer user name</_description>
+ <allow-empty>no</allow-empty>
+ </option>
+ <option type="password" name="RHTSupport_Password">
+ <_label>Password</_label>
+ <_description>Red Hat customer password</_description>
+ <allow-empty>no</allow-empty>
+ </option>
+ <option type="bool" name="RHTSupport_SSLVerify">
+ <_label>Verify SSL</_label>
+ <_description>Check SSL key validity</_description>
+ <default-value>yes</default-value>
+ </option>
+ </options>
+</event>
diff --git a/src/plugins/report_Tarball.xml.in b/src/plugins/report_Tarball.xml.in
new file mode 100644
index 0000000..03eae36
--- /dev/null
+++ b/src/plugins/report_Tarball.xml.in
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<event>
+ <_name>Save to tar archive</_name>
+ <_description>Save the problem data to a *.tar.gz in /tmp</_description>
+
+ <requires-items></requires-items>
+
<exclude-items-by-default>count,event_log,reported_to</exclude-items-by-default>
+ <exclude-items-always></exclude-items-always>
+ <exclude-binary-items>no</exclude-binary-items>
+ <include-items-by-default></include-items-by-default>
+ <minimal-rating>0</minimal-rating>
+</event>
diff --git a/src/plugins/reporter-rhtsupport.c b/src/plugins/reporter-rhtsupport.c
index 1c6b763..6f22887 100644
--- a/src/plugins/reporter-rhtsupport.c
+++ b/src/plugins/reporter-rhtsupport.c
@@ -274,21 +274,45 @@ int main(int argc, char **argv)
{
if (!case_no)
{
- /* -t: extract URL where we previously reported it */
+ /* -t: ask for it */
report_result_t *reported_to = get_reported_to(dump_dir_name);
if (!reported_to || !reported_to->url)
- error_msg_and_die("Can't attach: problem data in '%s'
"
- "was not reported to RHTSupport and therefore has no
URL",
- dump_dir_name);
- //log("URL:'%s'", reported_to->url);
- //log("MSG:'%s'", reported_to->msg);
+ {
+ case_no = ask(_("Case number:"));
+ if (!case_no)
+ perror_msg_and_die("ask");
+ if (case_no[0])
+ goto got_case_no;
+ /* User just pressed [enter] (or [cancel] in GIU). */
+ error_msg_and_die(_("Reporting cancelled"));
+ }
+ /* We have a preexisting URL */
+ log(_("Note: was already reported to '%s'"),
reported_to->url);
+#if 1
+ case_no = ask(_("Case number:"));
+#else
+ case_no = ask(_("Case number (default:previously reported
case):"));
+#endif
+ if (!case_no)
+ perror_msg_and_die("ask");
+ if (case_no[0])
+ goto got_case_no;
+#if 1
+ error_msg_and_die(_("Reporting cancelled"));
+#else
+//GUI BUG: would like to use this, but in GUI, [cancel] in ask dialog
+//also results in ""!
+//Enabling this will make [cancel] in GUI to NOT cancel!
+ /* User just pressed [enter]. Use previous URL */
free(url);
url = reported_to->url;
reported_to->url = NULL;
free_report_result(reported_to);
+#endif
}
else
{
+ got_case_no:;
/* -tCASE */
char *url1 = concat_path_file(url, "cases");
free(url);
diff --git a/src/plugins/rhtsupport_event.conf b/src/plugins/rhtsupport_event.conf
index 2e9b27e..c905d57 100644
--- a/src/plugins/rhtsupport_event.conf
+++ b/src/plugins/rhtsupport_event.conf
@@ -1 +1,8 @@
-EVENT=report_RHTSupport reporter-rhtsupport
+# On RHEL, we want "abrt-cli report DIR" to let users run
+# RHTS reporter (among other possible choices):
+EVENT=report_RHTSupport
+ reporter-rhtsupport
+
+EVENT=report_RHTSupportAttach
+ #TODO: make -t w/o CASE_NO ask for case no using ask()
+ reporter-rhtsupport -t
diff --git a/src/plugins/tarball_event.conf b/src/plugins/tarball_event.conf
new file mode 100644
index 0000000..a0307c8
--- /dev/null
+++ b/src/plugins/tarball_event.conf
@@ -0,0 +1,4 @@
+EVENT=report_Tarball
+ # without target URL, this merely creates a tarball in /tmp
+ #TODO: make better tarball name: try to use the same basename as the directory name
+ reporter-upload
diff --git a/src/plugins/uploader_event.conf b/src/plugins/uploader_event.conf
index 2406008..1c624e7 100644
--- a/src/plugins/uploader_event.conf
+++ b/src/plugins/uploader_event.conf
@@ -1 +1,2 @@
-EVENT=report_Uploader analyzer=libreport reporter-upload
+EVENT=report_Uploader analyzer=libreport
+ reporter-upload
--
1.7.1