diff options
author | 2012-04-19 15:58:09 +0200 | |
---|---|---|
committer | 2012-04-19 15:58:09 +0200 | |
commit | 535da2a53b24e20444b09f89a6055f89784cfce3 (patch) | |
tree | 3be1ed596c917c2ceec015cf152c60037d5bcbdd | |
parent | Also consider STABLEREQ bugs for maintainer timeout. (diff) | |
download | arch-tools-535da2a53b24e20444b09f89a6055f89784cfce3.tar.gz arch-tools-535da2a53b24e20444b09f89a6055f89784cfce3.tar.bz2 arch-tools-535da2a53b24e20444b09f89a6055f89784cfce3.zip |
The new python interface to bugzilla does not handle logging in and out
at the lower level; this is now part of the command line interface. As a
result, we need to prompt for a username and password and log in
ourselves. This will be used in the updated arch testing tools.
-rw-r--r-- | common.py | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -3,6 +3,7 @@ import cStringIO import datetime +import getpass import re import portage @@ -42,6 +43,27 @@ def expand_braces(orig): return list(set(res)) +def get_input(prompt): + return raw_input(prompt) + + +def login(bugzilla): + """Authenticate a session. + """ + # prompt for username + user = get_input('Bugzilla Username: ') + + # prompt for password + password = getpass.getpass() + + # perform login + params = {} + params['login'] = user + params['password'] = password + print 'Logging in' + bugzilla.User.login(params) + + class Bug: def __init__(self, xml=None, id_number=None, summary=None, status=None): if xml is not None: |