commit b74b8f9a36cbe17350399094de2b4ba26830ae8f
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sat May 24 17:11:41 2014 +0200
Honor the --username and --password command line arguments
Fixes
https://bugzilla.redhat.com/show_bug.cgi?id=1100497
pkgdb2_cli.py | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/pkgdb2_cli.py b/pkgdb2_cli.py
index fd84fc0..e698dc7 100644
--- a/pkgdb2_cli.py
+++ b/pkgdb2_cli.py
@@ -61,14 +61,15 @@ def __do_login(username=None, password=None):
if pkgdbclient.is_logged_in:
return
else:
- if username is None:
+ if username is None and pkgdbclient.username is None:
try:
username = fedora_cert.read_user_cert()
except:
LOG.debug('Could not read Fedora cert, using login name')
username = raw_input('FAS username: ')
- password = getpass.getpass('FAS password: ')
- pkgdbclient.username = username
+ pkgdbclient.username = username
+ if password is None and pkgdbclient.password is None:
+ password = getpass.getpass('FAS password: ')
pkgdbclient.login(username, password)
@@ -672,6 +673,11 @@ def main():
return_code = 0
+ if arg.password:
+ pkgdbclient.password = arg.password
+ if arg.username:
+ pkgdbclient.username = arg.username
+
try:
arg.func(arg)
except KeyboardInterrupt: