Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
keyring.core.set_keyring(
keyring.core.load_keyring("keyring.backends.OS_X.Keyring")
)
return keyring
elif WIN:
if "TRAVIS" in os.environ:
keyring = dummyKeyRing
return keyring
import keyring # nocoverage (Fails on Travis CI)
keyring.core.set_keyring(
keyring.core.load_keyring(
"keyring.backends.Windows.WinVaultKeyring"
)
) # nocoverage (Fails on Travis CI)
return keyring # nocoverage (Fails on Travis CI)
elif LINUX:
try:
import keyring
keyring.core.set_keyring(
keyring.core.load_keyring(
"keyring.backends.kwallet.DBusKeyring"
)
)
except Exception:
def keyring(self):
try:
if MAC:
import keyring
keyring.core.set_keyring(keyring.core.load_keyring('keyring.backends.OS_X.Keyring'))
return keyring
elif WIN:
if 'TRAVIS' in os.environ:
keyring = dummyKeyRing
return keyring
import keyring #nocoverage (Fails on Travis CI)
keyring.core.set_keyring(keyring.core.load_keyring('keyring.backends.Windows.WinVaultKeyring')) #nocoverage (Fails on Travis CI)
return keyring #nocoverage (Fails on Travis CI)
elif LINUX:
try:
import keyring
def os_keyring():
"""Initialize the openstack keyring."""
ring = 'openstackclient.common.openstackkeyring.OpenStackKeyring'
return keyring.core.load_keyring(None, ring)
try:
if MAC:
import keyring
keyring.core.set_keyring(keyring.core.load_keyring('keyring.backends.OS_X.Keyring'))
return keyring
elif WIN:
if 'TRAVIS' in os.environ:
keyring = dummyKeyRing
return keyring
import keyring #nocoverage (Fails on Travis CI)
keyring.core.set_keyring(keyring.core.load_keyring('keyring.backends.Windows.WinVaultKeyring')) #nocoverage (Fails on Travis CI)
return keyring #nocoverage (Fails on Travis CI)
elif LINUX:
try:
import keyring
keyring.core.set_keyring(keyring.core.load_keyring('keyring.backends.kwallet.DBusKeyring'))
except:
keyring = dummyKeyRing
return keyring
except Exception as e: self.handleTraceback(sourceMethod = getattr(self, sys._getframe().f_code.co_name), e = e)
def _load_backend(self):
keyring_backend = keyring.core.load_keyring(self._backend_cls_name)
keyring.set_keyring(keyring_backend)
def keyring(self):
try:
if MAC:
import keyring
keyring.core.set_keyring(
keyring.core.load_keyring("keyring.backends.OS_X.Keyring")
)
return keyring
elif WIN:
if "TRAVIS" in os.environ:
keyring = dummyKeyRing
return keyring
import keyring # nocoverage (Fails on Travis CI)
keyring.core.set_keyring(
keyring.core.load_keyring(
"keyring.backends.Windows.WinVaultKeyring"
)
) # nocoverage (Fails on Travis CI)