From dbd928a4b7ec66e10cf4b3c0e310ca211d76bbc2 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Fri, 6 Jun 2008 09:38:52 -0400 Subject: Fix cookie handling for bugzilla installations not on root of host, add some logging, abstractify login method --- bugzilla/bugzilla3.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'bugzilla/bugzilla3.py') diff --git a/bugzilla/bugzilla3.py b/bugzilla/bugzilla3.py index 5e38c97..6849358 100644 --- a/bugzilla/bugzilla3.py +++ b/bugzilla/bugzilla3.py @@ -21,6 +21,10 @@ class Bugzilla3(bugzilla.base.BugzillaBase): bugzilla.base.BugzillaBase.__init__(self,**kwargs) self.user_agent = user_agent + def _login(self,user,password): + '''Backend login method for Bugzilla3''' + return self._proxy.User.login({'login':user,'password':password}) + #---- Methods and properties with basic bugzilla info def _getuserforid(self,userid): @@ -83,7 +87,8 @@ class Bugzilla3(bugzilla.base.BugzillaBase): in 'displaycolumns', and the SQL query used by this query will be in 'sql'. ''' - return self._proxy.bugzilla.runQuery(query,self.user,self.password) + #return self._proxy.bugzilla.runQuery(query,self.user,self.password) + raise NotImplementedError, "Bugzilla 3.0 does not support this method." #---- Methods for modifying existing bugs. @@ -203,8 +208,12 @@ class Bugzilla3(bugzilla.base.BugzillaBase): #---- createbug - call to create a new bug + createbug_required = ('product','component','summary','version', + 'op_sys','platform') + def _createbug(self,**data): '''Raw xmlrpc call for createBug() Doesn't bother guessing defaults or checking argument validity. Use with care. - Returns [bug_id, mailresults]''' - return self._proxy.bugzilla.createBug(data,self.user,self.password) + Returns bug_id''' + r = self._proxy.Bug.create(data) + return r['id'] -- cgit