summaryrefslogtreecommitdiffstats
path: root/lib/Plugins/Bugzilla.cpp
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-09-07 14:09:05 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-09-07 14:09:05 +0200
commit9a8effd59d69dc557f5e2931a3577a314697a259 (patch)
tree8d2af7c61d573cec27c195149f225f0b962df127 /lib/Plugins/Bugzilla.cpp
parent65dc5d049ed7cb0ae91612a5cfb1e3358c0a9bfd (diff)
parentbedff13356fa8c4325b30595bc4a052caaf501ed (diff)
downloadabrt-9a8effd59d69dc557f5e2931a3577a314697a259.tar.gz
abrt-9a8effd59d69dc557f5e2931a3577a314697a259.tar.xz
abrt-9a8effd59d69dc557f5e2931a3577a314697a259.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib/Plugins/Bugzilla.cpp')
-rw-r--r--lib/Plugins/Bugzilla.cpp43
1 files changed, 24 insertions, 19 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp
index 64aa1ef..c11fa0f 100644
--- a/lib/Plugins/Bugzilla.cpp
+++ b/lib/Plugins/Bugzilla.cpp
@@ -78,6 +78,11 @@ void CReporterBugzilla::Login()
xmlrpc_c::rpcPtr rpc(new xmlrpc_c::rpc("User.login", paramList));
try
{
+ if( (m_sLogin == "") && (m_sPassword=="") )
+ {
+ log("Empty login and password");
+ throw std::string(_("Empty login and password. Please check Bugzilla.conf"));
+ }
rpc->call(m_pXmlrpcClient, m_pCarriageParm);
ret = xmlrpc_c::value_struct(rpc->getResult());
std::stringstream ss;
@@ -88,6 +93,10 @@ void CReporterBugzilla::Login()
{
throw CABRTException(EXCEP_PLUGIN, std::string("CReporterBugzilla::Login(): ") + e.what());
}
+ catch (std::string& s)
+ {
+ throw CABRTException(EXCEP_PLUGIN, s);
+ }
}
void CReporterBugzilla::Logout()
@@ -218,11 +227,6 @@ std::string CReporterBugzilla::CheckUUIDInBugzilla(const std::string& pComponent
log("Bug is already reported: %s", ss.str().c_str());
update_client(_("Bug is already reported: ") + ss.str());
- if (!CheckCCAndReporter(ss.str()) && m_bLoggedIn)
- {
- AddPlusOneComment(ss.str());
- AddPlusOneCC(ss.str());
- }
return ss.str();
}
return "";
@@ -410,25 +414,26 @@ std::string CReporterBugzilla::Report(const map_crash_report_t& pCrashReport, co
NewXMLRPCClient();
- update_client(_("Checking for duplicates..."));
+
+ m_bLoggedIn = false;
try
{
- if ((bugId = CheckUUIDInBugzilla(component, uuid)) != "")
- {
+ update_client(_("Checking for duplicates..."));
+ bugId = CheckUUIDInBugzilla(component, uuid);
+ if ( bugId != "" ) {
+ update_client(_("Logging into bugzilla..."));
+ Login();
+ m_bLoggedIn = true;
+ update_client(_("Check CC and add coment +1..."));
+ if (!CheckCCAndReporter(bugId) && m_bLoggedIn)
+ {
+ AddPlusOneComment(bugId);
+ AddPlusOneCC(bugId);
+ }
DeleteXMLRPCClient();
return m_sBugzillaURL + "/show_bug.cgi?id=" + bugId;
}
- }
- catch (CABRTException& e)
- {
- DeleteXMLRPCClient();
- throw CABRTException(EXCEP_PLUGIN, std::string("CReporterBugzilla::Report(): ") + e.what());
- }
-
- m_bLoggedIn = false;
- update_client(_("Logging into bugzilla..."));
- try
- {
+ update_client(_("Logging into bugzilla..."));
Login();
m_bLoggedIn = true;
}