diff options
author | Javeme <zhangmei.li@easystack.cn> | 2016-02-24 11:58:15 +0800 |
---|---|---|
committer | Javeme <zhangmei.li@easystack.cn> | 2016-02-24 13:19:53 +0800 |
commit | 3288c4d7e2f1a44edf05f2b157e294898838e272 (patch) | |
tree | 5bf24ca9d8cf76dc516d8685368ea56647b6a14b | |
parent | 339a6236b312f43f39073bfba476f75a14d6a17c (diff) | |
download | oslo-messaging-3288c4d7e2f1a44edf05f2b157e294898838e272.tar.gz |
Use more efficient mask_dict_password to mask password
The mask_dict_password method is added from oslo_utils 3.4.0, and it's
about five times faster than the mask_password method, so it's better
to use mask_dict_password instead of mask_password.
Change-Id: I6629ed1232f2e6f1c72b9f13b361e2f9e14b50a4
-rw-r--r-- | oslo_messaging/notify/_impl_log.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/oslo_messaging/notify/_impl_log.py b/oslo_messaging/notify/_impl_log.py index fa6e1f3..7322f07 100644 --- a/oslo_messaging/notify/_impl_log.py +++ b/oslo_messaging/notify/_impl_log.py @@ -40,7 +40,7 @@ class LogDriver(notifier.Driver): message['event_type'])) method = getattr(logger, priority.lower(), None) if method: - method(strutils.mask_password(jsonutils.dumps(message))) + method(jsonutils.dumps(strutils.mask_dict_password(message))) else: warnings.warn('Unable to log message as notify cannot find a ' 'logger with the priority specified ' |