summaryrefslogtreecommitdiffstats
path: root/lib/Plugins/Bugzilla.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-09-03 15:55:13 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-09-03 15:55:13 +0200
commitcd4f64729225a41ac7b6040e32aca1c9635812b0 (patch)
tree6a0b0605b8e54cff17f137c51c21cd02990a1ff2 /lib/Plugins/Bugzilla.cpp
parentcb8148e315e20e4a2d8a65b7b0bdd832352dad97 (diff)
parent8eda15fffa03559e3e1fa7499896f7d6a55124d1 (diff)
downloadabrt-cd4f64729225a41ac7b6040e32aca1c9635812b0.tar.gz
abrt-cd4f64729225a41ac7b6040e32aca1c9635812b0.tar.xz
abrt-cd4f64729225a41ac7b6040e32aca1c9635812b0.zip
Merge branch 'master' of ssh://vda@git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib/Plugins/Bugzilla.cpp')
-rw-r--r--lib/Plugins/Bugzilla.cpp47
1 files changed, 38 insertions, 9 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp
index f1e90ea..64aa1ef 100644
--- a/lib/Plugins/Bugzilla.cpp
+++ b/lib/Plugins/Bugzilla.cpp
@@ -16,7 +16,8 @@ CReporterBugzilla::CReporterBugzilla() :
m_pCarriageParm(NULL),
m_sBugzillaURL("https://bugzilla.redhat.com"),
m_sBugzillaXMLRPC("https://bugzilla.redhat.com" + std::string(XML_RPC_SUFFIX)),
- m_bNoSSLVerify(false)
+ m_bNoSSLVerify(false),
+ m_bLoggedIn(false)
{}
CReporterBugzilla::~CReporterBugzilla()
@@ -217,7 +218,7 @@ 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()))
+ if (!CheckCCAndReporter(ss.str()) && m_bLoggedIn)
{
AddPlusOneComment(ss.str());
AddPlusOneCC(ss.str());
@@ -406,19 +407,44 @@ std::string CReporterBugzilla::Report(const map_crash_report_t& pCrashReport, co
std::string component = pCrashReport.find(FILENAME_COMPONENT)->second[CD_CONTENT];
std::string uuid = pCrashReport.find(CD_UUID)->second[CD_CONTENT];
std::string bugId;
- update_client(_("Logging into bugzilla..."));
+
NewXMLRPCClient();
+ update_client(_("Checking for duplicates..."));
try
{
- Login();
- update_client(_("Checking for duplicates..."));
- if ((bugId = CheckUUIDInBugzilla(component, uuid)) == "")
+ if ((bugId = CheckUUIDInBugzilla(component, uuid)) != "")
{
- update_client(_("Creating new bug..."));
- bugId = NewBug(pCrashReport);
- AddAttachments(bugId, pCrashReport);
+ 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
+ {
+ Login();
+ m_bLoggedIn = true;
+ }
+ catch (CABRTException& e)
+ {
+ DeleteXMLRPCClient();
+ throw CABRTException(EXCEP_PLUGIN, std::string("CReporterBugzilla::Report(): ") + e.what());
+ return "";
+ }
+
+
+ update_client(_("Creating new bug..."));
+ try
+ {
+ bugId = NewBug(pCrashReport);
+ AddAttachments(bugId, pCrashReport);
update_client(_("Logging out..."));
Logout();
}
@@ -427,8 +453,11 @@ std::string CReporterBugzilla::Report(const map_crash_report_t& pCrashReport, co
DeleteXMLRPCClient();
throw CABRTException(EXCEP_PLUGIN, std::string("CReporterBugzilla::Report(): ") + e.what());
}
+
+
DeleteXMLRPCClient();
return m_sBugzillaURL + "/show_bug.cgi?id=" + bugId;
+
}
void CReporterBugzilla::SetSettings(const map_plugin_settings_t& pSettings)