Skip to content

Commit

Permalink
Add debug logging for credential location
Browse files Browse the repository at this point in the history
This makes it easier to troubleshoot any credential
issues.  Only the location of the credentials is logged,
not the actual credentials themselves.
  • Loading branch information
jamesls committed Dec 11, 2012
1 parent 5394f30 commit f5fa988
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion boto/provider.py
Expand Up @@ -230,22 +230,27 @@ def _credentials_need_refresh(self):
else:
return False


def get_credentials(self, access_key=None, secret_key=None):
access_key_name, secret_key_name = self.CredentialMap[self.name]
if access_key is not None:
self.access_key = access_key
boto.log.debug("Using access key provided by client.")
elif access_key_name.upper() in os.environ:
self.access_key = os.environ[access_key_name.upper()]
boto.log.debug("Using access key found in environment variable.")
elif config.has_option('Credentials', access_key_name):
self.access_key = config.get('Credentials', access_key_name)
boto.log.debug("Using access key found in config file.")

if secret_key is not None:
self.secret_key = secret_key
boto.log.debug("Using secret key provided by client.")
elif secret_key_name.upper() in os.environ:
self.secret_key = os.environ[secret_key_name.upper()]
boto.log.debug("Using secret key found in environment variable.")
elif config.has_option('Credentials', secret_key_name):
self.secret_key = config.get('Credentials', secret_key_name)
boto.log.debug("Using secret key found in config file.")

if ((self._access_key is None or self._secret_key is None) and
self.MetadataServiceSupport[self.name]):
Expand Down

0 comments on commit f5fa988

Please sign in to comment.