diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2009-09-03 15:41:31 +0200 |
---|---|---|
committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2009-09-03 15:41:31 +0200 |
commit | b59407f9fed1a47cfab0b9f63c10df2bccb50574 (patch) | |
tree | 78172ad55bcbf3b472e19c5cccbf4d373412638e /lib/Plugins | |
parent | 3ff673f93242f55c98bf7cad9bf5c1dd8b751326 (diff) | |
download | abrt-b59407f9fed1a47cfab0b9f63c10df2bccb50574.tar.gz abrt-b59407f9fed1a47cfab0b9f63c10df2bccb50574.tar.xz abrt-b59407f9fed1a47cfab0b9f63c10df2bccb50574.zip |
Change report logic.
* Check duplicity. If duplicity exist, return bug id
* Login
* Report bug
* Logout
Diffstat (limited to 'lib/Plugins')
-rw-r--r-- | lib/Plugins/Bugzilla.cpp | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index 2e975cda..64aa1ef2 100644 --- a/lib/Plugins/Bugzilla.cpp +++ b/lib/Plugins/Bugzilla.cpp @@ -408,9 +408,25 @@ std::string CReporterBugzilla::Report(const map_crash_report_t& pCrashReport, co std::string uuid = pCrashReport.find(CD_UUID)->second[CD_CONTENT]; std::string bugId; + + NewXMLRPCClient(); + update_client(_("Checking for duplicates...")); + 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()); + } + m_bLoggedIn = false; update_client(_("Logging into bugzilla...")); - NewXMLRPCClient(); try { Login(); @@ -418,33 +434,17 @@ std::string CReporterBugzilla::Report(const map_crash_report_t& pCrashReport, co } 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()); + return ""; } + + update_client(_("Creating new bug...")); try { - update_client(_("Checking for duplicates...")); - if ((bugId = CheckUUIDInBugzilla(component, uuid)) == "") - { - update_client(_("Creating new bug...")); - bugId = NewBug(pCrashReport); - AddAttachments(bugId, pCrashReport); - } + bugId = NewBug(pCrashReport); + AddAttachments(bugId, pCrashReport); update_client(_("Logging out...")); Logout(); } @@ -453,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) |