diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-08-19 13:06:14 +0200 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-08-19 13:06:14 +0200 |
| commit | 8ea9df91cdd1ece81191d1347c5c952bf519b0e3 (patch) | |
| tree | e8e3286c8d4ddcdb6a0d417be5238164ffb652ee /lib/Plugins/Bugzilla.cpp | |
| parent | 60e24c1893f1d5c221600412794df0561efa8716 (diff) | |
| download | abrt-8ea9df91cdd1ece81191d1347c5c952bf519b0e3.tar.gz abrt-8ea9df91cdd1ece81191d1347c5c952bf519b0e3.tar.xz abrt-8ea9df91cdd1ece81191d1347c5c952bf519b0e3.zip | |
BZ plugin: removed /xmlrpc.cgi from config, made the report message more user friendly
Diffstat (limited to 'lib/Plugins/Bugzilla.cpp')
| -rw-r--r-- | lib/Plugins/Bugzilla.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index 5e3602f..a79f308 100644 --- a/lib/Plugins/Bugzilla.cpp +++ b/lib/Plugins/Bugzilla.cpp @@ -11,7 +11,8 @@ CReporterBugzilla::CReporterBugzilla() : m_pXmlrpcTransport(NULL), m_pXmlrpcClient(NULL), m_pCarriageParm(NULL), - m_sBugzillaURL("https://bugzilla.redhat.com/xmlrpc.cgi"), + m_sBugzillaURL("https://bugzilla.redhat.com"), + m_sBugzillaXMLRPC("https://bugzilla.redhat.com" + std::string(XML_RPC_SUFFIX)), m_bNoSSLVerify(false) {} @@ -26,7 +27,7 @@ void CReporterBugzilla::NewXMLRPCClient() .no_ssl_verifypeer(m_bNoSSLVerify) ); m_pXmlrpcClient = new xmlrpc_c::client_xml(m_pXmlrpcTransport); - m_pCarriageParm = new xmlrpc_c::carriageParm_curl0(m_sBugzillaURL); + m_pCarriageParm = new xmlrpc_c::carriageParm_curl0(m_sBugzillaXMLRPC); } void CReporterBugzilla::DeleteXMLRPCClient() @@ -386,7 +387,7 @@ std::string CReporterBugzilla::Report(const map_crash_report_t& pCrashReport, co throw CABRTException(EXCEP_PLUGIN, std::string("CReporterBugzilla::Report(): ") + e.what()); } DeleteXMLRPCClient(); - return "See bug in bugzilla: " + m_sBugzillaURL + ", bug id:" + bugId; + return m_sBugzillaURL + "/show_bug.cgi?id=" + bugId; } void CReporterBugzilla::SetSettings(const map_plugin_settings_t& pSettings) @@ -394,6 +395,18 @@ void CReporterBugzilla::SetSettings(const map_plugin_settings_t& pSettings) if (pSettings.find("BugzillaURL") != pSettings.end()) { m_sBugzillaURL = pSettings.find("BugzillaURL")->second; + //remove the /xmlrpc.cgi part from old settings + //FIXME: can be removed after users are informed about new config format + std::string::size_type pos = m_sBugzillaURL.find("/xmlrpc.cgi"); + if(pos != std::string::npos){ + m_sBugzillaURL.erase(pos); + } + //remove the trailing '/' + if(*(--m_sBugzillaURL.end()) == '/') + { + m_sBugzillaURL.erase(--m_sBugzillaURL.end()); + } + m_sBugzillaXMLRPC = m_sBugzillaURL + std::string(XML_RPC_SUFFIX); } if (pSettings.find("Login") != pSettings.end()) { |
