summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2009-09-07 13:37:13 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2009-09-07 13:37:13 +0200
commita15efc2c47aaa0a0388f0fd337a217cf3577c3f4 (patch)
tree2208c2399ef85bcbb36fd02e97ba51c164073a75 /lib
parentde35eadd5dc9231dcf7f561cbbe07d3b6636cf84 (diff)
downloadabrt-a15efc2c47aaa0a0388f0fd337a217cf3577c3f4.tar.gz
abrt-a15efc2c47aaa0a0388f0fd337a217cf3577c3f4.tar.xz
abrt-a15efc2c47aaa0a0388f0fd337a217cf3577c3f4.zip
Add checker if bugzilla login and password are filled in.
Diffstat (limited to 'lib')
-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 64aa1ef2..c11fa0f2 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;
}