[openSUSE/osc] b8482b: Osc.postoptparse only returns if the get_config ca...
Branch: refs/heads/master Home: https://github.com/openSUSE/osc Commit: b8482bfab36475ac9a32943c288f574b0cb7a2fe https://github.com/openSUSE/osc/commit/b8482bfab36475ac9a32943c288f574b0cb7a... Author: Marcus Huewe <suse-tux@gmx.de> Date: 2021-11-23 (Tue, 23 Nov 2021) Changed paths: M osc/commandline.py Log Message: ----------- 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") Commit: bf9e046f2f11e1a03433f11863c7b26cf225994c https://github.com/openSUSE/osc/commit/bf9e046f2f11e1a03433f11863c7b26cf2259... Author: Marcus Huewe <suse-tux@gmx.de> Date: 2021-12-01 (Wed, 01 Dec 2021) Changed paths: M osc/commandline.py Log Message: ----------- Merge branch 'always_parse_config' of https://github.com/marcus-h/osc Osc.postoptparse only returns if the get_config call succeeds. Compare: https://github.com/openSUSE/osc/compare/8da29dc7663b...bf9e046f2f11
participants (1)
-
Marcus Hüwe