1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-21 01:36:16 +02:00

- fixed bnc#801027 ("osc starts with a traceback")

This commit is contained in:
Marcus Huewe 2013-02-25 18:06:32 +01:00
parent 907e5f67a5
commit e2dc1d7fe6

View File

@ -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)