summaryrefslogtreecommitdiffstats
path: root/lib/Plugins/Bugzilla.cpp
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2010-01-21 17:54:57 +0100
committerNikola Pajkovsky <npajkovs@redhat.com>2010-01-21 17:54:57 +0100
commit2afa768308a7f00f0f0d5c4a95f5b20e8c62ef39 (patch)
treeb1dd818660f085f7608e5bb9809a7304c43d0137 /lib/Plugins/Bugzilla.cpp
parent562cb414ee83452749058c2c976019c663111e55 (diff)
downloadabrt-2afa768308a7f00f0f0d5c4a95f5b20e8c62ef39.tar.gz
abrt-2afa768308a7f00f0f0d5c4a95f5b20e8c62ef39.tar.xz
abrt-2afa768308a7f00f0f0d5c4a95f5b20e8c62ef39.zip
fix double filled bug with same status_whiteboard(abrt hash)
Diffstat (limited to 'lib/Plugins/Bugzilla.cpp')
-rw-r--r--lib/Plugins/Bugzilla.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp
index aafa0198..5dc4298a 100644
--- a/lib/Plugins/Bugzilla.cpp
+++ b/lib/Plugins/Bugzilla.cpp
@@ -11,7 +11,9 @@
# include <config.h>
#endif
-#define XML_RPC_SUFFIX "/xmlrpc.cgi"
+#define XML_RPC_SUFFIX "/xmlrpc.cgi"
+#define NEW_BUG -1
+#define MISSING_MEMBER -2
/*
* TODO: npajkovs: better deallocation of xmlrpc value
@@ -235,7 +237,7 @@ int32_t ctx::check_uuid_in_bugzilla(const char* component, const char* UUID)
{
xmlrpc_DECREF(result);
xmlrpc_DECREF(bugs_member);
- return -1;
+ return NEW_BUG;
}
xmlrpc_value* item = NULL;
@@ -270,12 +272,20 @@ int32_t ctx::check_uuid_in_bugzilla(const char* component, const char* UUID)
xmlrpc_DECREF(result);
return bug_id;
}
+ else
+ {
+ VERB3 log("Missing member 'bug_id'");
+ }
xmlrpc_DECREF(item);
xmlrpc_DECREF(bugs_member);
}
+ else
+ {
+ VERB3 log("Missing member 'bugs'");
+ }
xmlrpc_DECREF(result);
- return -1;
+ return MISSING_MEMBER;
}
uint32_t ctx::new_bug(const map_crash_data_t& pCrashData)
@@ -447,6 +457,7 @@ std::string CReporterBugzilla::Report(const map_crash_data_t& pCrashData,
VERB3 log("Empty login and password");
throw CABRTException(EXCEP_PLUGIN, _("Empty login and password. Please check Bugzilla.conf"));
}
+
update_client(_("Logging into bugzilla..."));
bz_server.login(Login.c_str(), Password.c_str());
@@ -463,9 +474,12 @@ std::string CReporterBugzilla::Report(const map_crash_data_t& pCrashData,
return BugzillaURL;
}
- update_client(_("Creating new bug..."));
- bug_id = bz_server.new_bug(pCrashData);
- bz_server.add_attachments(to_string(bug_id).c_str(), pCrashData);
+ if (bug_id == NEW_BUG)
+ {
+ update_client(_("Creating new bug..."));
+ bug_id = bz_server.new_bug(pCrashData);
+ bz_server.add_attachments(to_string(bug_id).c_str(), pCrashData);
+ }
update_client(_("Logging out..."));
bz_server.logout();