Permalink
Browse files

Add log messages for keyring support

  • Loading branch information...
1 parent a35a8bc commit c3971e32ae71fb50c678c805363ce607cc2ed54b @jamesls jamesls committed Dec 21, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 boto/provider.py
View
@@ -253,9 +253,16 @@ def get_credentials(self, access_key=None, secret_key=None):
boto.log.debug("Using secret key found in config file.")
elif config.has_option('Credentials', 'keyring'):
keyring_name = config.get('Credentials', 'keyring')
- import keyring
+ try:
+ import keyring
+ except ImportError:
+ boto.log.error("The keyring module could not be imported. "
+ "For keyring support, install the keyring "
+ "module.")
+ raise
self.secret_key = keyring.get_password(
keyring_name, self.access_key)
+ boto.log.debug("Using secret key found in keyring.")
if ((self._access_key is None or self._secret_key is None) and
self.MetadataServiceSupport[self.name]):

0 comments on commit c3971e3

Please sign in to comment.