diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-09-18 14:42:24 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-09-18 14:42:24 -0300 |
commit | 5d3f7c101b07329f8bdb557fe538f340a2b607d9 (patch) | |
tree | 673de29d648810e2277a82eee43c2b49545248d2 /src | |
parent | f5247bf3baafbc5c5e83fb667aa05fc632e33496 (diff) | |
parent | e0e85e8c375ed1afe297b1ff047cb5db13a837b0 (diff) |
Merge remote-tracking branch 'kali/bug/workaround_keyring_imports' into develop
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/bitmask/util/keyring_helpers.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/leap/bitmask/util/keyring_helpers.py b/src/leap/bitmask/util/keyring_helpers.py index 8f354f28..4b3eb57f 100644 --- a/src/leap/bitmask/util/keyring_helpers.py +++ b/src/leap/bitmask/util/keyring_helpers.py @@ -14,16 +14,21 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. - """ Keyring helpers. """ +import logging import keyring +from keyring.backends.file import EncryptedKeyring, PlaintextKeyring + +logger = logging.getLogger(__name__) + + OBSOLETE_KEYRINGS = [ - keyring.backends.file.EncryptedKeyring, - keyring.backends.file.PlaintextKeyring + EncryptedKeyring, + PlaintextKeyring ] @@ -34,4 +39,10 @@ def has_keyring(): :rtype: bool """ kr = keyring.get_keyring() - return kr is not None and kr.__class__ not in OBSOLETE_KEYRINGS + klass = kr.__class__ + logger.debug("Selected keyring: %s" % (klass,)) + + canuse = kr is not None and klass not in OBSOLETE_KEYRINGS + if not canuse: + logger.debug("Not using this keyring since it is obsolete") + return canuse |