From e2dc1d7fe655d61654d0c442704320fa3e5688e1 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Mon, 25 Feb 2013 18:06:32 +0100 Subject: [PATCH] - fixed bnc#801027 ("osc starts with a traceback") --- osc/conf.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/osc/conf.py b/osc/conf.py index 38ea2c9d..cfcfc5c2 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -798,6 +798,7 @@ def get_config(override_conffile=None, scheme, host = parse_apisrv_url(config.get('scheme', 'https'), url) apiurl = urljoin(scheme, host) user = None + password = None if config['use_keyring'] and GENERIC_KEYRING: try: # Read from keyring lib if available @@ -827,6 +828,13 @@ def get_config(override_conffile=None, print >>sys.stderr, 'Warning: blank user in the keyring for the ' \ 'apiurl %s.\nPlease fix your keyring entry.' + if user is not None and password is None: + err = ('no password defined for "%s".\nPlease fix your keyring ' + 'entry or gnome-keyring setup.\nAssuming an empty password.' + % url) + print >>sys.stderr, err + password = '' + # Read credentials from config if user is None: #FIXME: this could actually be the ideal spot to take defaults @@ -858,9 +866,6 @@ def get_config(override_conffile=None, if not config['plaintext_passwd']: password = passwordx - if password is None or len(password) == 0: - print >>sys.stderr, 'no password defined for ', url, '.\nPlease fix your keyring entry or python-keyring setup.' - if cp.has_option(url, 'http_headers'): http_headers = cp.get(url, 'http_headers') http_headers = http_header_regexp.findall(http_headers)