summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-03-16 13:32:40 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-03-16 13:32:40 +0100
commit4e777ad483ae0b433ce80a4662fe33b64f43464d (patch)
treeb3d31f576ed02c9d3880e566bb9459c26079dac4 /src
parent9aae7a7b9a6d7d3c67827bda3b8ac1e57f0f48dd (diff)
downloadabrt-4e777ad483ae0b433ce80a4662fe33b64f43464d.tar.gz
abrt-4e777ad483ae0b433ce80a4662fe33b64f43464d.tar.xz
abrt-4e777ad483ae0b433ce80a4662fe33b64f43464d.zip
bugzilla reporter fixes
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/abrt_xmlrpc.cpp3
-rw-r--r--src/plugins/abrt-action-bugzilla.cpp47
-rw-r--r--src/plugins/report_Bugzilla.conf2
3 files changed, 26 insertions, 26 deletions
diff --git a/src/lib/abrt_xmlrpc.cpp b/src/lib/abrt_xmlrpc.cpp
index e2b8674c..ae75a47f 100644
--- a/src/lib/abrt_xmlrpc.cpp
+++ b/src/lib/abrt_xmlrpc.cpp
@@ -40,8 +40,7 @@ void abrt_xmlrpc_conn::new_xmlrpc_client(const char* url, bool ssl_verify)
xmlrpc_env env;
xmlrpc_env_init(&env);
- /* This should be done at program startup, once.
- * We do it in abrtd's main */
+ /* This should be done at program startup, once. We do it in main */
/* xmlrpc_client_setup_global_const(&env); */
/* URL - bugzilla.redhat.com/show_bug.cgi?id=666893 Unable to make sense of
diff --git a/src/plugins/abrt-action-bugzilla.cpp b/src/plugins/abrt-action-bugzilla.cpp
index c77a2bad..8911ac46 100644
--- a/src/plugins/abrt-action-bugzilla.cpp
+++ b/src/plugins/abrt-action-bugzilla.cpp
@@ -124,35 +124,34 @@ struct ctx: public abrt_xmlrpc_conn {
xmlrpc_value* ctx::call(const char* method, const char* format, ...)
{
- va_list args;
- xmlrpc_value* param = NULL;
xmlrpc_value* result = NULL;
- const char* suffix;
-
- va_start(args, format);
- xmlrpc_build_value_va(&env, format, args, &param, &suffix);
- va_end(args);
if (!env.fault_occurred)
{
+ xmlrpc_value* param = NULL;
+ va_list args;
+ const char* suffix;
+
+ va_start(args, format);
+ xmlrpc_build_value_va(&env, format, args, &param, &suffix);
+ va_end(args);
+
if (*suffix != '\0')
{
xmlrpc_env_set_fault_formatted(
&env, XMLRPC_INTERNAL_ERROR, "Junk after the argument "
"specifier: '%s'. There must be exactly one arument.",
suffix);
-
- xmlrpc_DECREF(param);
- return NULL;
}
-
- xmlrpc_client_call2(&env, m_pClient, m_pServer_info, method, param, &result);
+ else
+ {
+ xmlrpc_client_call2(&env, m_pClient, m_pServer_info, method, param, &result);
+ }
xmlrpc_DECREF(param);
if (env.fault_occurred)
return NULL;
}
-
return result;
}
@@ -618,10 +617,13 @@ int ctx::get_bug_info(struct bug_info* bz, xmlrpc_int32 bug_id)
void ctx::login(const char* login, const char* passwd)
{
xmlrpc_value* result = call("User.login", "({s:s,s:s})", "login", login, "password", passwd);
+//TODO: with URL like http://bugzilla.redhat.com (that is, with http: instead of https:)
+//we are getting this error:
+//Logging into Bugzilla at http://bugzilla.redhat.com
+//Can't login. Server said: HTTP response code is 301, not 200
+//But this is a 301 redirect! We _can_ follow it if we configure curl to understand that!
if (!result)
- error_msg_and_die("Can't login. Check Edit->Plugins->Bugzilla "
- "and /etc/abrt/plugins/Bugzilla.conf. Server said: %s",
- env.fault_string);
+ error_msg_and_die("Can't login. Server said: %s", env.fault_string);
xmlrpc_DECREF(result);
}
@@ -660,7 +662,6 @@ static void report_to_bugzilla(
password = env ? env : get_map_string_item_or_empty(settings, "Password");
if (!login[0] || !password[0])
{
- VERB3 log("Empty login and password");
error_msg_and_die(_("Empty login or password, please check %s"), PLUGINS_CONF_DIR"/Bugzilla.conf");
}
@@ -681,10 +682,10 @@ static void report_to_bugzilla(
ctx bz_server(bugzilla_xmlrpc, ssl_verify);
- log(_("Logging into bugzilla..."));
+ log(_("Logging into Bugzilla at %s"), bugzilla_url);
bz_server.login(login, password);
- log(_("Checking for duplicates..."));
+ log(_("Checking for duplicates"));
char *product = NULL;
char *version = NULL;
@@ -773,7 +774,7 @@ static void report_to_bugzilla(
}
else if (all_bugs_size == 0) // Create new bug
{
- log(_("Creating a new bug..."));
+ log(_("Creating a new bug"));
bug_id = bz_server.new_bug(crash_data, depend_on_bugno);
if (bug_id < 0)
{
@@ -781,7 +782,7 @@ static void report_to_bugzilla(
error_msg_and_die(_("Bugzilla entry creation failed"));
}
- log("Adding attachments to bug %ld...", (long)bug_id);
+ log("Adding attachments to bug %ld", (long)bug_id);
char bug_id_str[sizeof(long)*3 + 2];
sprintf(bug_id_str, "%ld", (long) bug_id);
int ret = bz_server.add_attachments(bug_id_str, crash_data);
@@ -790,7 +791,7 @@ static void report_to_bugzilla(
throw_if_xml_fault_occurred(&bz_server.env);
}
- log(_("Logging out..."));
+ log(_("Logging out"));
bz_server.logout();
log("Status: NEW %s/show_bug.cgi?id=%u",
@@ -889,7 +890,7 @@ static void report_to_bugzilla(
}
}
- log(_("Logging out..."));
+ log(_("Logging out"));
bz_server.logout();
log("Status: %s%s%s %s/show_bug.cgi?id=%u",
diff --git a/src/plugins/report_Bugzilla.conf b/src/plugins/report_Bugzilla.conf
index 0a18c07a..f1a77f50 100644
--- a/src/plugins/report_Bugzilla.conf
+++ b/src/plugins/report_Bugzilla.conf
@@ -1,4 +1,4 @@
-Bugzilla_BugzillaURL = http://bugzilla.redhat.com
+Bugzilla_BugzillaURL = https://bugzilla.redhat.com
Bugzilla_Login =
Bugzilla_Password =
Bugzilla_SSLVerify = yes