mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-25 17:36:13 +01:00
Merge pull request #1431 from dmach/fix-keyring-keyutils-callable-password
Fix retrieving a password in case a function returns another callable
This commit is contained in:
commit
2aa7c17331
@ -104,6 +104,11 @@ class Password(collections.UserString):
|
||||
# we use the password only from time to time to make a session cookie
|
||||
# and there's no need to keep the password in program memory longer than necessary
|
||||
result = self._data()
|
||||
|
||||
# the function can also return a function, let's evaluate them recursively
|
||||
while callable(result):
|
||||
result = result()
|
||||
|
||||
if result is None:
|
||||
raise oscerr.OscIOError(None, "Unable to retrieve password")
|
||||
return result
|
||||
|
Loading…
Reference in New Issue
Block a user