diff --git a/swift/account/auditor.py b/swift/account/auditor.py index acb7483409..7aa26c0757 100644 --- a/swift/account/auditor.py +++ b/swift/account/auditor.py @@ -41,6 +41,7 @@ class AccountAuditor(DatabaseAuditor): if policy_totals[key] == info[key]: continue return InvalidAccountInfo( - 'The total %(key)s for the container (%(total)s) does not ' - 'match the sum of %(key)s across policies (%(sum)s)' - % {'key': key, 'total': info[key], 'sum': policy_totals[key]}) + 'The total %(key)s for the account %(account)s (%(total)s) ' + 'does not match the sum of %(key)s across policies (%(sum)s)' + % {'key': key, 'account': info.get('account'), + 'total': info[key], 'sum': policy_totals[key]}) diff --git a/test/unit/account/test_auditor.py b/test/unit/account/test_auditor.py index f0ecc9d8fa..37410af736 100644 --- a/test/unit/account/test_auditor.py +++ b/test/unit/account/test_auditor.py @@ -125,8 +125,9 @@ class TestAuditorRealBroker(unittest.TestCase): self.assertEqual(len(error_lines), 1) error_message = error_lines[0] self.assertIn(broker.db_file, error_message) - self.assertIn('container_count', error_message) - self.assertIn('does not match', error_message) + self.assertIn( + 'The total container_count for the account a (3) does not match ' + 'the sum of container_count across policies (2)', error_message) self.assertEqual(test_auditor.logger.get_increment_counts(), {'failures': 1})