diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-04-24 20:26:53 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-04-24 20:26:53 +0000 |
commit | 214a6e440a45a986fe4d0aede3bcd8cd704e4ff5 (patch) | |
tree | a1f31d276186fdef304ba0a847ea618424d2779c | |
parent | c10602a917d4d57a56cd3e962930c24888c0d6ab (diff) | |
parent | fd683e81cc776d295548f03a2603aa5fc39758d6 (diff) | |
download | tempest-214a6e440a45a986fe4d0aede3bcd8cd704e4ff5.tar.gz |
Merge "Add logging of account allocation to accounts provider"
-rw-r--r-- | tempest/common/accounts.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tempest/common/accounts.py b/tempest/common/accounts.py index acf6d4fa9..93c8bcf79 100644 --- a/tempest/common/accounts.py +++ b/tempest/common/accounts.py @@ -180,12 +180,20 @@ class Accounts(cred_provider.CredentialProvider): useable_hashes = hashes return useable_hashes + def _sanitize_creds(self, creds): + temp_creds = creds.copy() + temp_creds.pop('password') + return temp_creds + def _get_creds(self, roles=None): if self.use_default_creds: raise exceptions.InvalidConfiguration( "Account file %s doesn't exist" % CONF.auth.test_accounts_file) useable_hashes = self._get_match_hash_list(roles) free_hash = self._get_free_hash(useable_hashes) + clean_creds = self._sanitize_creds( + self.hash_dict['creds'][free_hash]) + LOG.info('%s allocated creds:\n%s' % (self.name, clean_creds)) return self._wrap_creds_with_network(free_hash) @lockutils.synchronized('test_accounts_io', external=True) @@ -216,7 +224,9 @@ class Accounts(cred_provider.CredentialProvider): def remove_credentials(self, creds): _hash = self.get_hash(creds) + clean_creds = self._sanitize_creds(self.hash_dict['creds'][_hash]) self.remove_hash(_hash) + LOG.info("%s returned allocated creds:\n%s" % (self.name, clean_creds)) def get_primary_creds(self): if self.isolated_creds.get('primary'): |