Skip to content

Commit 0461403

Browse files
committed
fix #283: don't import keyring unless needed.
Now we only import the keyring right where we use it. This will be helpful on Linux servers that don't have keyrings.
1 parent 473371e commit 0461403

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

user_sync/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import subprocess
2626
import types
2727

28-
import keyring
2928
import yaml
3029
import six
3130

@@ -600,6 +599,7 @@ def get_credential(self, name, user_name, none_allowed=False):
600599
raise AssertionException('%s: cannot contain setting for both "%s" and "%s"' % (scope, name, keyring_name))
601600
if secure_value_key:
602601
try:
602+
import keyring
603603
value = keyring.get_password(service_name=secure_value_key, username=user_name)
604604
except Exception as e:
605605
raise AssertionException('%s: Error accessing secure storage: %s' % (scope, e))

0 commit comments

Comments
 (0)