From d14cf52f7687b7dbb7af3bf4b6c267c3ff5d8f4a Mon Sep 17 00:00:00 2001 From: Jon Stanley Date: Mon, 13 Oct 2008 20:19:01 -0400 Subject: added addUser() method --- bugzilla/base.py | 10 ++++++++++ bugzilla/rhbugzilla.py | 3 +++ 2 files changed, 13 insertions(+) (limited to 'bugzilla') 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 -- cgit