diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-11-27 23:23:17 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-11-27 23:23:17 +0000 |
commit | 6eb39a9a2c76cefc5a2c1af071516a68f1e0672f (patch) | |
tree | bbec5dd87194576708a3d8e5427a1d9ae2784903 | |
parent | e0b179217beb1a0d12c849aeecbc210c622b62db (diff) | |
parent | 470ba0a26a8a15211639331d040812b47d745106 (diff) | |
download | ceilometer-6eb39a9a2c76cefc5a2c1af071516a68f1e0672f.tar.gz |
Merge "Sync strutils from oslo-incubator for mask_password fix" into stable/juno
-rw-r--r-- | ceilometer/openstack/common/strutils.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ceilometer/openstack/common/strutils.py b/ceilometer/openstack/common/strutils.py index 9814195d..0305a14d 100644 --- a/ceilometer/openstack/common/strutils.py +++ b/ceilometer/openstack/common/strutils.py @@ -292,7 +292,12 @@ def mask_password(message, secret="***"): >>> mask_password("u'original_password' : u'aaaaa'") "u'original_password' : u'***'" """ - message = six.text_type(message) + try: + message = six.text_type(message) + except UnicodeDecodeError: + # NOTE(jecarey): Temporary fix to handle cases where message is a + # byte string. A better solution will be provided in Kilo. + pass # NOTE(ldbragst): Check to see if anything in message contains any key # specified in _SANITIZE_KEYS, if not then just return the message since |