Beispiel #1
0
    def create_credential_store(cls) -> CredentialsProviderInterface:
        """
        Factory method for determining which store to use
        """
        keyring_name = KeystoreWrapper.get_keyring_name()
        if keyring_name in SUPPORTED_BACKENDS:
            # If the keyring is unlocked then we will use it
            if KeystoreWrapper.is_keyring_accessible():
                return KeystoreCredentialsProvider()

        return FileCredentialsProvider()
Beispiel #2
0
 def __init__(self):  # pragma: no cover
     self.keyring_name = KeystoreWrapper.get_keyring_name()
 def test_get_keyring_name_use_proper_log_level(self):
     logging.getLogger('keyring').setLevel(logging.DEBUG)
     KeystoreWrapper.get_keyring_name()
     self.assertEquals(logging.getLogger('keyring').level, logging.INFO)