Log a fixed length string of asterisks for obfuscation

Change-Id: I98e95dbc92712bebb18dcf0d29af7cfe7f2c8124
Closes-bug: #1341774
This commit is contained in:
Zhongyue Luo 2014-08-05 10:36:50 +08:00
parent 46eabcca65
commit a590c2afee
2 changed files with 2 additions and 2 deletions

View File

@ -1972,7 +1972,7 @@ class ConfigOpts(collections.Mapping):
def _sanitize(opt, value):
"""Obfuscate values of options declared secret."""
return value if not opt.secret else '*' * len(str(value))
return value if not opt.secret else '*' * 4
for opt_name in sorted(self._opts):
opt = self._get_opt_info(opt_name)['opt']

View File

@ -2803,7 +2803,7 @@ class OptDumpingTestCase(BaseTestCase):
"foo = this",
"passwd = ****",
"blaa.bar = that",
"blaa.key = *****",
"blaa.key = ****",
"*" * 80,
])