commit 2bf09acaf87b5cec09e854f97d22aa3b9c19bc53 Author: Pierre-Yves Chibon pingou@pingoured.fr Date: Mon Nov 24 11:17:38 2014 +0100
Retrieve the username and use it when creating the FAS client
The username allowing to load/save the session data from the filesystem
pkgdb2client/utils.py | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) --- diff --git a/pkgdb2client/utils.py b/pkgdb2client/utils.py index 74aef5d..a6e4edb 100644 --- a/pkgdb2client/utils.py +++ b/pkgdb2client/utils.py @@ -18,13 +18,22 @@ import getpass
from bugzilla import Bugzilla +import fedora_cert from fedora.client import AccountSystem, AuthError
import pkgdb2client
+try: + USERNAME = fedora_cert.read_user_cert() +except fedora_cert.fedora_cert_error: + LOG.debug('Could not read Fedora cert, asking for username') + USERNAME = None + RH_BZ_API = 'https://bugzilla.redhat.com/xmlrpc.cgi' BZCLIENT = Bugzilla(url=RH_BZ_API) -FASCLIENT = AccountSystem('https://admin.fedoraproject.org/accounts') +FASCLIENT = AccountSystem( + 'https://admin.fedoraproject.org/accounts', + username=USERNAME)
def bz_login():
packagedb-cli-commits@lists.stg.fedorahosted.org