Skip to content

Commit 5a978b9

Browse files
author
ting.wang
committed
Replace string format arguments with function parameters
There are files containing string format arguments inside logging messages. Using logging function parameters should be preferred. Change-Id: I15b405bf4d4715263fe1e1262982467b3d4bc1f4 Closes-Bug: #1321274
1 parent ab6ba38 commit 5a978b9

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

openstackclient/api/auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def select_auth_plugin(options):
106106
# The ultimate default is similar to the original behaviour,
107107
# but this time with version discovery
108108
auth_plugin_name = 'osc_password'
109-
LOG.debug("Auth plugin %s selected" % auth_plugin_name)
109+
LOG.debug("Auth plugin %s selected", auth_plugin_name)
110110
return auth_plugin_name
111111

112112

@@ -130,7 +130,7 @@ def build_auth_params(auth_plugin_name, cmd_options):
130130
auth_plugin_class = None
131131
plugin_options = set([o.replace('-', '_') for o in get_options_list()])
132132
for option in plugin_options:
133-
LOG.debug('fetching option %s' % option)
133+
LOG.debug('fetching option %s', option)
134134
auth_params[option] = getattr(cmd_options.auth, option, None)
135135
return (auth_plugin_class, auth_params)
136136

openstackclient/api/auth_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def create_plugin(self, session, version, url, raw_status=None):
9797
ver_u.query,
9898
ver_u.fragment,
9999
))
100-
LOG.debug('Version URL updated: %s' % url)
100+
LOG.debug('Version URL updated: %s', url)
101101

102102
return super(OSCGenericPassword, self).create_plugin(
103103
session=session,

openstackclient/common/clientmanager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ def setup_auth(self):
167167
elif 'tenant_name' in self._auth_params:
168168
self._project_name = self._auth_params['tenant_name']
169169

170-
LOG.info('Using auth plugin: %s' % self.auth_plugin_name)
171-
LOG.debug('Using parameters %s' %
170+
LOG.info('Using auth plugin: %s', self.auth_plugin_name)
171+
LOG.debug('Using parameters %s',
172172
strutils.mask_password(self._auth_params))
173173
self.auth = auth_plugin.load_from_options(**self._auth_params)
174174
# needed by SAML authentication

openstackclient/compute/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def make_client(instance):
4242
else:
4343
version = instance._api_version[API_NAME]
4444

45-
LOG.debug('Instantiating compute client for V%s' % version)
45+
LOG.debug('Instantiating compute client for V%s', version)
4646

4747
# Set client http_log_debug to True if verbosity level is high enough
4848
http_log_debug = utils.get_effective_log_level() <= logging.DEBUG

0 commit comments

Comments
 (0)