Skip to content

Commit 7e7f755

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Mask passwords in debug logs for auth_config_hook"
2 parents 5ba5e1e + cd1a412 commit 7e7f755

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

openstackclient/common/client_config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
from os_client_config import config
1919
from os_client_config import exceptions as occ_exceptions
20+
from oslo_utils import strutils
21+
import six
2022

2123

2224
LOG = logging.getLogger(__name__)
@@ -180,7 +182,9 @@ def auth_config_hook(self, config):
180182
config = self._auth_v2_ignore_v3(config)
181183
config = self._auth_default_domain(config)
182184

183-
LOG.debug("auth_config_hook(): %s" % config)
185+
if LOG.isEnabledFor(logging.DEBUG):
186+
LOG.debug("auth_config_hook(): %s",
187+
strutils.mask_password(six.text_type(config)))
184188
return config
185189

186190
def load_auth_plugin(self, config):

0 commit comments

Comments
 (0)