diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-08-06 17:43:39 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-08-06 17:43:39 +0000 |
commit | dc5081aab5d0d7e1124263831839e493f21b0bfb (patch) | |
tree | 4e21aa8e50b408906904a6fa919f8e128ba7a2b7 | |
parent | 2cf77bbc59f6c37196f086dc3c694c1bbe7fbb1b (diff) | |
parent | a590c2afee3a08abb0f80e4b07674a6a4f53ed3a (diff) | |
download | oslo-config-dc5081aab5d0d7e1124263831839e493f21b0bfb.tar.gz |
Merge "Log a fixed length string of asterisks for obfuscation"
-rw-r--r-- | oslo/config/cfg.py | 2 | ||||
-rw-r--r-- | tests/test_cfg.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/oslo/config/cfg.py b/oslo/config/cfg.py index 555b910..0ff708e 100644 --- a/oslo/config/cfg.py +++ b/oslo/config/cfg.py @@ -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'] diff --git a/tests/test_cfg.py b/tests/test_cfg.py index 9e98391..7b6d282 100644 --- a/tests/test_cfg.py +++ b/tests/test_cfg.py @@ -2803,7 +2803,7 @@ class OptDumpingTestCase(BaseTestCase): "foo = this", "passwd = ****", "blaa.bar = that", - "blaa.key = *****", + "blaa.key = ****", "*" * 80, ]) |