From 3288c4d7e2f1a44edf05f2b157e294898838e272 Mon Sep 17 00:00:00 2001 From: Javeme Date: Wed, 24 Feb 2016 11:58:15 +0800 Subject: [PATCH] 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 --- oslo_messaging/notify/_impl_log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oslo_messaging/notify/_impl_log.py b/oslo_messaging/notify/_impl_log.py index fa6e1f3cf..7322f07b6 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 '