summaryrefslogtreecommitdiffstats
path: root/bugzilla
diff options
context:
space:
mode:
authorJon Stanley <jonstanley@gmail.com>2008-10-13 20:19:01 -0400
committerJon Stanley <jonstanley@gmail.com>2008-10-13 20:19:01 -0400
commitd14cf52f7687b7dbb7af3bf4b6c267c3ff5d8f4a (patch)
tree934e60a86ae2ebda01ba6b1c73213134323194a5 /bugzilla
parent8f0699ef42d08890009a0ce8fff1e22b1b69fd7f (diff)
downloadpython-bugzilla-d14cf52f7687b7dbb7af3bf4b6c267c3ff5d8f4a.tar.gz
python-bugzilla-d14cf52f7687b7dbb7af3bf4b6c267c3ff5d8f4a.tar.xz
python-bugzilla-d14cf52f7687b7dbb7af3bf4b6c267c3ff5d8f4a.zip
added addUser() method
Diffstat (limited to 'bugzilla')
-rw-r--r--bugzilla/base.py10
-rw-r--r--bugzilla/rhbugzilla.py3
2 files changed, 13 insertions, 0 deletions
diff --git a/bugzilla/base.py b/bugzilla/base.py
index 0fde57e..7ae6086 100644
--- a/bugzilla/base.py
+++ b/bugzilla/base.py
@@ -360,6 +360,9 @@ class BugzillaBase(object):
def _updateperms(self,user,action,group):
'''IMPLEMEMT ME: Update Bugzilla user permissions'''
raise NotImplementedError
+ def _adduser(self,email,name):
+ '''IMPLEMENT ME: Add a bugzilla user'''
+ raise NotImplementedError
# these return Bug objects
def getbug(self,id):
@@ -677,6 +680,13 @@ class BugzillaBase(object):
groups: list of groups to be added to (i.e. ['fedora_contrib'])
'''
self._updateperms(user,action,groups)
+ def adduser(self,email,name):
+ '''A method to create a user in Bugzilla. Takes the following:
+
+ email: The email address of the user to create
+ name: The full name of the user to create
+ '''
+ self._adduser(email,name)
class CookieResponse:
'''Fake HTTPResponse object that we can fill with headers we got elsewhere.
diff --git a/bugzilla/rhbugzilla.py b/bugzilla/rhbugzilla.py
index 8eeed0d..51e9a11 100644
--- a/bugzilla/rhbugzilla.py
+++ b/bugzilla/rhbugzilla.py
@@ -330,6 +330,9 @@ class RHBugzilla(bugzilla.base.BugzillaBase):
def _updateperms(self,user,action,groups):
r = self._proxy.bugzilla.updatePerms(user, action, groups, self.user)
return r
+ def _adduser(self,email,name):
+ r = self._proxy.bugzilla.addUser(user, name, self.user)
+ return r
class RHBugzilla3(Bugzilla32, RHBugzilla):
'''Concrete implementation of the Bugzilla protocol. This one uses the