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 | |
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')
-rw-r--r-- | lib/Plugins/Bugzilla.conf | 2 | ||||
-rw-r--r-- | lib/Plugins/Bugzilla.cpp | 19 | ||||
-rw-r--r-- | lib/Plugins/Bugzilla.h | 3 |
3 files changed, 20 insertions, 4 deletions
diff --git a/lib/Plugins/Bugzilla.conf b/lib/Plugins/Bugzilla.conf index 8c2bcdf0..4d5bcba4 100644 --- a/lib/Plugins/Bugzilla.conf +++ b/lib/Plugins/Bugzilla.conf @@ -1,5 +1,5 @@ # Bugzilla URL -BugzillaURL = https://bugzilla.redhat.com/xmlrpc.cgi +BugzillaURL = https://bugzilla.redhat.com/ # yes means that ssl certificates will not be checked NoSSLVerify = no # your login has to exist, if you don have anyone, please create one diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index 5e3602f4..a79f308e 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()) { diff --git a/lib/Plugins/Bugzilla.h b/lib/Plugins/Bugzilla.h index 575de1f0..7280f4f0 100644 --- a/lib/Plugins/Bugzilla.h +++ b/lib/Plugins/Bugzilla.h @@ -7,6 +7,8 @@ #include <nssb64.h> +#define XML_RPC_SUFFIX "/xmlrpc.cgi" + class CReporterBugzilla : public CReporter { private: @@ -32,6 +34,7 @@ class CReporterBugzilla : public CReporter xmlrpc_c::client_xml* m_pXmlrpcClient; xmlrpc_c::carriageParm_curl0 *m_pCarriageParm; std::string m_sBugzillaURL; + std::string m_sBugzillaXMLRPC; std::string m_sLogin; std::string m_sPassword; std::string m_sAttchmentInBase64; |