Resolve and enable H702 PEP8 rule
H702 Formatting operation should be outside of localization method call Change-Id: I83e3a7e3d7f19d3238ee91dcab730d55d479a65e
This commit is contained in:
parent
9a26a3f4c3
commit
a8518aecce
@ -255,7 +255,7 @@ def setup_logging():
|
||||
return
|
||||
else:
|
||||
raise RuntimeError(_("Unable to locate specified logging "
|
||||
"config file: %s" % CONF.log_config))
|
||||
"config file: %s") % CONF.log_config)
|
||||
|
||||
root_logger = logging.root
|
||||
if CONF.debug:
|
||||
@ -354,8 +354,9 @@ def load_paste_app(app_name=None):
|
||||
|
||||
return app
|
||||
except (LookupError, ImportError) as e:
|
||||
msg = _("Unable to load %(app_name)s from "
|
||||
"configuration file %(conf_file)s. \nGot: %(e)r",
|
||||
{'conf_file': conf_file, 'app_name': app_name, 'e': e})
|
||||
msg = _("Unable to load %(app_name)s from configuration file"
|
||||
" %(conf_file)s. \nGot: %(e)r") % {'conf_file': conf_file,
|
||||
'app_name': app_name,
|
||||
'e': e}
|
||||
logger.error(msg)
|
||||
raise RuntimeError(msg)
|
||||
|
@ -93,4 +93,4 @@ class StatsCollectingService(service.Service):
|
||||
self._stats_db.update(self._hostname, stats)
|
||||
except Exception as e:
|
||||
LOG.error(_("Failed to get statistics object "
|
||||
"form a database. %s" % e))
|
||||
"form a database. {0}").format(e))
|
||||
|
@ -939,7 +939,7 @@ class FormDataDeserializer(TextDeserializer):
|
||||
def _from_json(self, datastring):
|
||||
value = datastring
|
||||
try:
|
||||
LOG.debug(_("Trying deserialize '{0}' to json".format(datastring)))
|
||||
LOG.debug(_("Trying deserialize '{0}' to json").format(datastring))
|
||||
value = jsonutils.loads(datastring)
|
||||
except ValueError:
|
||||
LOG.debug(_("Unable deserialize to json, using raw text"))
|
||||
|
3
tox.ini
3
tox.ini
@ -40,10 +40,9 @@ commands = oslo-config-generator --config-file etc/oslo-config-generator/murano.
|
||||
[flake8]
|
||||
# H233 Python 3.x incompatible use of print operator
|
||||
# H405 Multi line docstring summary not separated with an empty line
|
||||
# H702 Argument to _ must be just a string
|
||||
# H904 Wrap long lines in parentheses instead of a backslash
|
||||
|
||||
ignore = H233,H405,H702,H904
|
||||
ignore = H233,H405,H904
|
||||
show-source = true
|
||||
builtins = _
|
||||
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools
|
||||
|
Loading…
x
Reference in New Issue
Block a user