1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-03 18:16:17 +01:00
github.com_openSUSE_osc/osc
Marcus Huewe b8482bfab3 Osc.postoptparse only returns if the get_config call succeeds
The old code passes try_again=False to the recursive postoptparse
call when calling it from one of the exception handlers. This is
wrong because it can result in an incomplete conf.config dict (for
instance, if two apiurl sections have no user and no password and
no credentials_mgr_class option - see #761 ("Traceback config with
two backends and no username")).
Hence, Osc.postoptparse should only return if the conf.get_config
call succeeds. For this, unconditionally call Osc.postoptparse from
within the exception handlers. Note: this could potentially (although
quite unlikely) result in an endless recursion but in each recursive
call "user" interaction is required (that is, the user could simply
press CTRL+c) - so this should not be a problem.

Implementation note: this change breaks the API. Rationale: the
semantics of Osc.postoptparse changed. Hence, "pretending" to
honor the try_again parameter could result in unexpected behavior
(from the API consumer's POV). Hence, a traceback might be more
sensible.

Fixes: #761 ("Traceback config with two backends and no username")
2021-11-23 15:34:48 +01:00
..
util support zst compressed control files in deb archives 2021-10-26 07:29:43 +02:00
__init__.py replace urlgrabber to enable python3 compatibility 2018-10-19 09:31:37 +02:00
.gitignore convert svn:ignore to gitignore 2009-12-03 19:19:53 +01:00
babysitter.py Improve error message in case of an URLError 2021-09-30 14:09:08 +02:00
build.py fix hdmrd5 check of local cached files 2021-10-19 16:01:24 +02:00
checker.py Resolve PEP8 issue W291 2014-08-12 15:01:16 +02:00
cmdln.py add regex for python3 missing arguments err 2020-05-18 19:46:22 +02:00
commandline.py Osc.postoptparse only returns if the get_config call succeeds 2021-11-23 15:34:48 +01:00
conf.py Improve logic for conffile mode handling 2021-10-25 09:34:16 +10:00
core.py Improve error message in case of an URLError 2021-09-30 14:09:08 +02:00
credentials.py fix list of backends for old python-keyring 2020-02-14 09:35:07 +01:00
fetch.py fix hdmrd5 check of local cached files 2021-10-19 16:01:24 +02:00
grabber.py fix broken URLError handling in OscMirrorGroup.urlgrab() 2018-11-06 13:29:17 +01:00
meter.py Fix ZeroDivisionException in meter.PBTextMeter 2019-01-23 15:37:01 +01:00
OscConfigParser.py Rename SafeConfigParser to ConfigParser 2020-02-07 12:04:49 +01:00
oscerr.py Improve password handling 2019-08-29 16:11:17 +02:00
oscssl.py Use correct appname for trusted-certs store 2019-07-28 14:59:14 +02:00
oscsslexcp.py - remove shebang line to make rpmlint happy 2010-03-21 22:57:06 +01:00