commit:     85a5fa0e24d89b5b8a41cc63f4c59e2e46faa4a6
Author:     Pawel Hajdan, Jr <phajdan.jr <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 14 09:41:35 2014 +0000
Commit:     Paweł Hajdan <phajdan.jr <AT> gentoo <DOT> org>
CommitDate: Sat Jun 14 09:41:35 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/arch-tools.git;a=commit;h=85a5fa0e

Fix issue in batch-stabilize leading to errors from Bugzilla

xmlrpclib.Fault: <Fault 410: 'You must log in before using this part of
Bugzilla.'>

---
 batch-stabilize.py    | 3 ++-
 common.py             | 5 +----
 maintainer-timeout.py | 2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/batch-stabilize.py b/batch-stabilize.py
index 2093da5..053cd19 100755
--- a/batch-stabilize.py
+++ b/batch-stabilize.py
@@ -68,7 +68,7 @@ if __name__ == "__main__":
        url = 'https://bugs.gentoo.org/xmlrpc.cgi'
        print 'You will be prompted for your Gentoo Bugzilla username and 
password (%s).' % url
        bugzilla = BugzillaProxy(url)
-       login(bugzilla)
+       user, login_data = login(bugzilla)
        
        with open(options.input_filename, "r") as input_file:
                stabilization_dict = {}
@@ -188,6 +188,7 @@ if __name__ == "__main__":
                                # We don't close bugs which still have other 
arches for obvious reasons,
                                # and security bugs because stabilization is 
not the last step for them.
                                params = {}
+                               params['token'] = login_data['token']
                                params['ids'] = [bug_id]
                                params['cc'] = {}
                                params['cc']['remove'] = ['%s...@gentoo.org' % 
options.arch]

diff --git a/common.py b/common.py
index cf89eb7..578b0e0 100644
--- a/common.py
+++ b/common.py
@@ -69,10 +69,7 @@ def login(bugzilla):
        params = {}
        params['login'] = user
        params['password'] = password
-       print 'Logging in'
-       bugzilla.User.login(params)
-
-       return user
+       return user, bugzilla.User.login(params)
 
 
 class Bug:

diff --git a/maintainer-timeout.py b/maintainer-timeout.py
index ba8c322..76c7e59 100755
--- a/maintainer-timeout.py
+++ b/maintainer-timeout.py
@@ -29,7 +29,7 @@ if __name__ == "__main__":
        url = 'https://bugs.gentoo.org/xmlrpc.cgi'
        print 'You will be prompted for your Gentoo Bugzilla username and 
password (%s).' % url
        bugzilla = BugzillaProxy(url)
-       user = login(bugzilla)
+       user, login_data = login(bugzilla)
        
        bugs = bugzilla.Bug.search({'reporter': user, 'summary': ['stabilize', 
'stabilization', 'stable'], 'resolution': ''})['bugs']
        comments = bugzilla.Bug.comments({'ids': [bug['id'] for bug in bugs]})

Reply via email to