summaryrefslogtreecommitdiffstats
path: root/lib/Plugins
diff options
context:
space:
mode:
authorZdenek Prikryl <zprikryl@redhat.com>2009-09-03 09:06:21 +0200
committerZdenek Prikryl <zprikryl@redhat.com>2009-09-03 09:06:21 +0200
commit8faaf4477b07463d92a9f3fa1d869771ada37f46 (patch)
tree122d4897878645473d51b211d8bb5f0f4a4cc871 /lib/Plugins
parentb927326567365834e1132d3d79c68f7db00a6faa (diff)
downloadabrt-8faaf4477b07463d92a9f3fa1d869771ada37f46.tar.gz
abrt-8faaf4477b07463d92a9f3fa1d869771ada37f46.tar.xz
abrt-8faaf4477b07463d92a9f3fa1d869771ada37f46.zip
if login fails, then bugzilla tries to find a bug without login
Diffstat (limited to 'lib/Plugins')
-rw-r--r--lib/Plugins/Bugzilla.cpp32
-rw-r--r--lib/Plugins/Bugzilla.h1
2 files changed, 30 insertions, 3 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp
index f1e90eac..2e975cda 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,12 +407,37 @@ 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..."));
+ m_bLoggedIn = false;
+ update_client(_("Logging into bugzilla..."));
NewXMLRPCClient();
try
{
Login();
+ m_bLoggedIn = true;
+ }
+ catch (CABRTException& e)
+ {
+ update_client(_("Logging failed, trying to find a bug..."));
+ try
+ {
+ if ((bugId = CheckUUIDInBugzilla(component, uuid)) != "")
+ {
+ DeleteXMLRPCClient();
+ return m_sBugzillaURL + "/show_bug.cgi?id=" + bugId;
+ }
+ }
+ catch (CABRTException& e)
+ {
+ DeleteXMLRPCClient();
+ throw CABRTException(EXCEP_PLUGIN, std::string("CReporterBugzilla::Report(): ") + e.what());
+ }
+ DeleteXMLRPCClient();
+ throw CABRTException(EXCEP_PLUGIN, std::string("CReporterBugzilla::Report(): ") + e.what());
+ }
+
+ try
+ {
update_client(_("Checking for duplicates..."));
if ((bugId = CheckUUIDInBugzilla(component, uuid)) == "")
{
diff --git a/lib/Plugins/Bugzilla.h b/lib/Plugins/Bugzilla.h
index 6c7bfa0d..c5098b31 100644
--- a/lib/Plugins/Bugzilla.h
+++ b/lib/Plugins/Bugzilla.h
@@ -38,6 +38,7 @@ class CReporterBugzilla : public CReporter
std::string m_sPassword;
std::string m_sAttchmentInBase64;
bool m_bNoSSLVerify;
+ bool m_bLoggedIn;
public:
CReporterBugzilla();