Mask password when logging request body

Change-Id: I825ab268c140b991e39583cd2c2d557a202b7d97
Closes-Bug: #1697408
(cherry picked from commit f5f8a75963)
This commit is contained in:
Roey Chen 2017-06-12 05:36:23 -07:00
parent 96fbfe743a
commit d1af6cbbc8
1 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,7 @@ from neutron_lib import exceptions
from oslo_log import log as logging
from oslo_policy import policy as oslo_policy
from oslo_utils import excutils
from oslo_utils import strutils
import six
import webob.exc
@ -681,7 +682,8 @@ class Controller(object):
if not body:
raise webob.exc.HTTPBadRequest(_("Resource body required"))
LOG.debug("Request body: %(body)s", {'body': body})
LOG.debug("Request body: %(body)s",
{'body': strutils.mask_password(body)})
try:
if collection in body:
if not allow_bulk: