Signed-off-by: Denys Vlasenko dvlasenk@redhat.com --- src/applet/applet.c | 7 ++++++- src/daemon/abrt.conf | 4 ++-- src/plugins/abrt-action-ureport | 3 +-- tests/runtests/ureport/runtest.sh | 8 ++++---- tests/runtests/ureport/ureport-valid.py | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/applet/applet.c b/src/applet/applet.c index edc5ff7..4773d06 100644 --- a/src/applet/applet.c +++ b/src/applet/applet.c @@ -946,7 +946,6 @@ static gboolean handle_event_output_cb(GIOChannel *gio, GIOCondition condition, char *msg = state->cmd_output->buf;
VERB3 log("%s", msg); - pi->known |= (prefixcmp(msg, "THANKYOU") == 0);
strbuf_clear(state->cmd_output); /* jump to next line */ @@ -964,6 +963,12 @@ static gboolean handle_event_output_cb(GIOChannel *gio, GIOCondition condition, if (safe_waitpid(state->child_pid, &status, 0) <= 0) perror_msg("waitpid(%d)", (int)state->child_pid);
+ if (WIFEXITED(status) && WEXITSTATUS(status) == EXIT_STOP_EVENT_RUN) + { + pi->known = 1; + status = 0; + } + if (status == 0) { VERB3 log("fast report finished successfully"); diff --git a/src/daemon/abrt.conf b/src/daemon/abrt.conf index 6cc3376..7de4261 100644 --- a/src/daemon/abrt.conf +++ b/src/daemon/abrt.conf @@ -22,8 +22,8 @@ MaxCrashReportsSize = 1000 DeleteUploaded = no
# A name of event which is run automatically after problem's detection. The -# event should perform some fast analysis and print out THANKYOU message if the -# problem is konwn. +# event should perform some fast analysis and exit with 70 if the +# problem is known. # # In order to run this event automatically after detection, the # AutoreportingEnabled option must be configured to 'yes' diff --git a/src/plugins/abrt-action-ureport b/src/plugins/abrt-action-ureport index b82d1ce..07686f4 100644 --- a/src/plugins/abrt-action-ureport +++ b/src/plugins/abrt-action-ureport @@ -40,8 +40,7 @@ if test 0 -ne "$UREPORTS" && test 0 -ne "$COUNT" && test "$UREPORTS" -ge "$COUNT grep -e "^Bugzilla: " -e "^ABRT Server: " < reported_to | sort -u
if grep -q -e "^Bugzilla: " -e "^ABRT Server: " < reported_to; then - echo "THANKYOU" - exit 0 + exit 70 # EXIT_STOP_EVENT_RUN fi
log1 "Bug for '$PWD' not yet filed. Continuing." diff --git a/tests/runtests/ureport/runtest.sh b/tests/runtests/ureport/runtest.sh index 8bf7ea5..94a2e74 100755 --- a/tests/runtests/ureport/runtest.sh +++ b/tests/runtests/ureport/runtest.sh @@ -50,8 +50,8 @@ rlJournalStart rlRun "reporter-ureport -v --insecure --url http://localhost:12345/faf -d $crash_PATH &> ccpp_reporter" 0 "Send uReport" kill %1
- rlRun "./ureport-valid.py ccpp_ureport" 0 "Validate uReport contents" - rlAssertGrep "THANKYOU" ccpp_reporter + # 70 is EXIT_STOP_EVENT_RUN + rlRun "./ureport-valid.py ccpp_ureport" 70 "Validate uReport contents"
cp $crash_PATH/reported_to ccpp_reported_to rlAssertGrep "BTHASH=" ccpp_reported_to @@ -71,8 +71,8 @@ rlJournalStart rlRun "reporter-ureport -v --insecure --url http://localhost:12345/faf -d $crash_PATH &> python_reporter" 0 "Send uReport" kill %1
- rlRun "./ureport-valid.py python_ureport" 0 "Validate uReport contents" - rlAssertGrep "THANKYOU" python_reporter + # 70 is EXIT_STOP_EVENT_RUN + rlRun "./ureport-valid.py python_ureport" 70 "Validate uReport contents"
cp $crash_PATH/reported_to python_reported_to rlAssertGrep "BTHASH=" python_reported_to diff --git a/tests/runtests/ureport/ureport-valid.py b/tests/runtests/ureport/ureport-valid.py index ff06a41..7eaba05 100755 --- a/tests/runtests/ureport/ureport-valid.py +++ b/tests/runtests/ureport/ureport-valid.py @@ -169,6 +169,6 @@ if __name__ == "__main__": ureport = json.load(fh)
ureport = validate(ureport) - print "THANKYOU" + sys.exit(70) except Exception as ex: sys.exit("ERROR {0}".format(str(ex)))
On Wednesday 17 of April 2013 15:28:39 Denys Vlasenko wrote:
Signed-off-by: Denys Vlasenko dvlasenk@redhat.com
src/plugins/abrt-action-ureport | 3 +--
I had to apply the following patch because reporter-ureport doesn't return 0 if problem was reported.
Can I push it with this change?
diff --git a/src/plugins/abrt-action-ureport b/src/plugins/abrt-action-ureport index 07686f4..b6ae6a2 100644 --- a/src/plugins/abrt-action-ureport +++ b/src/plugins/abrt-action-ureport @@ -60,7 +60,9 @@ if test ! -s core_backtrace; then } fi
-reporter-ureport && { +reporter-ureport +RET_CODE=$? +if [ $RET_CODE -eq 0 ] || [ $RET_CODE -eq 70 ]; then printf "%s" "$((UREPORTS + 1))" > ureports_counter - exit 0 -} + exit $RET_CODE +fi
On 04/18/2013 04:08 PM, Jakub Filak wrote:
On Wednesday 17 of April 2013 15:28:39 Denys Vlasenko wrote:
Signed-off-by: Denys Vlasenko dvlasenk@redhat.com
src/plugins/abrt-action-ureport | 3 +--
I had to apply the following patch because reporter-ureport doesn't return 0 if problem was reported.
Can I push it with this change?
diff --git a/src/plugins/abrt-action-ureport b/src/plugins/abrt-action-ureport index 07686f4..b6ae6a2 100644 --- a/src/plugins/abrt-action-ureport +++ b/src/plugins/abrt-action-ureport @@ -60,7 +60,9 @@ if test ! -s core_backtrace; then } fi
-reporter-ureport && { +reporter-ureport +RET_CODE=$? +if [ $RET_CODE -eq 0 ] || [ $RET_CODE -eq 70 ]; then printf "%s" "$((UREPORTS + 1))" > ureports_counter
- exit 0
-}
- exit $RET_CODE
+fi
Yes, it looks good to me.
crash-catcher@lists.fedorahosted.org