From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 5D316138010 for ; Mon, 8 Oct 2012 16:03:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 15AEEE02DF; Mon, 8 Oct 2012 16:03:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8F38EE02DF for ; Mon, 8 Oct 2012 16:03:20 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F056733C34C for ; Mon, 8 Oct 2012 16:03:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 73C58E5436 for ; Mon, 8 Oct 2012 16:03:18 +0000 (UTC) From: "Paweł Hajdan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Paweł Hajdan" Message-ID: <1334843889.535da2a53b24e20444b09f89a6055f89784cfce3.phajdan.jr@gentoo> Subject: [gentoo-commits] proj/arch-tools:master commit in: / X-VCS-Repository: proj/arch-tools X-VCS-Files: common.py X-VCS-Directories: / X-VCS-Committer: phajdan.jr X-VCS-Committer-Name: Paweł Hajdan X-VCS-Revision: 535da2a53b24e20444b09f89a6055f89784cfce3 X-VCS-Branch: master Date: Mon, 8 Oct 2012 16:03:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 9899f09b-63ea-45a5-9759-2960508bb253 X-Archives-Hash: 40e9f916f3589a12846e6e436ed1a493 commit: 535da2a53b24e20444b09f89a6055f89784cfce3 Author: William Hubbs gentoo org> AuthorDate: Thu Apr 19 13:58:09 2012 +0000 Commit: Paweł Hajdan gentoo org> CommitDate: Thu Apr 19 13:58:09 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/arch-tools.git;a=commit;h=535da2a5 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. --- common.py | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/common.py b/common.py index ad25ad8..16abf70 100644 --- a/common.py +++ b/common.py @@ -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: