Skip to content

Commit eab508f

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Mask the sensitive values in debug log"
2 parents 155e8c6 + f0a81c2 commit eab508f

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

openstackclient/common/clientmanager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import pkg_resources
2121
import sys
2222

23+
from oslo_utils import strutils
2324
import requests
2425

2526
from openstackclient.api import auth
@@ -167,7 +168,8 @@ def setup_auth(self):
167168
self._project_name = self._auth_params['tenant_name']
168169

169170
LOG.info('Using auth plugin: %s' % self.auth_plugin_name)
170-
LOG.debug('Using parameters %s' % self._auth_params)
171+
LOG.debug('Using parameters %s' %
172+
strutils.mask_password(self._auth_params))
171173
self.auth = auth_plugin.load_from_options(**self._auth_params)
172174
# needed by SAML authentication
173175
request_session = requests.session()

openstackclient/shell.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from cliff import command
2626
from cliff import complete
2727
from cliff import help
28+
from oslo_utils import strutils
2829

2930
import openstackclient
3031
from openstackclient.common import clientmanager
@@ -201,8 +202,10 @@ def initialize_app(self, argv):
201202

202203
# Parent __init__ parses argv into self.options
203204
super(OpenStackShell, self).initialize_app(argv)
204-
self.log.info("START with options: %s", self.command_options)
205-
self.log.debug("options: %s", self.options)
205+
self.log.info("START with options: %s",
206+
strutils.mask_password(self.command_options))
207+
self.log.debug("options: %s",
208+
strutils.mask_password(self.options))
206209

207210
# Set the default plugin to token_endpoint if url and token are given
208211
if (self.options.url and self.options.token):
@@ -246,7 +249,8 @@ def initialize_app(self, argv):
246249
self.log_configurator.configure(self.cloud)
247250
self.dump_stack_trace = self.log_configurator.dump_trace
248251
self.log.debug("defaults: %s", cc.defaults)
249-
self.log.debug("cloud cfg: %s", self.cloud.config)
252+
self.log.debug("cloud cfg: %s",
253+
strutils.mask_password(self.cloud.config))
250254

251255
# Set up client TLS
252256
# NOTE(dtroyer): --insecure is the non-default condition that

0 commit comments

Comments
 (0)