Fix and enable H701 check "Empty localization string"

Change-Id: Iae800f38cadb3d4f68ac4b70dd2d758d39a7f359
Closes-Bug: #1351196
This commit is contained in:
Akihiro Motoki 2014-08-01 17:09:25 +09:00
parent 588d1de8fa
commit 5319c21e0e
3 changed files with 4 additions and 5 deletions

View File

@ -158,7 +158,7 @@ class AlreadyExists(HorizonException):
"""
def __init__(self, name, resource_type):
self.attrs = {"name": name, "resource": resource_type}
self.msg = 'A %(resource)s with the name "%(name)s" already exists.'
self.msg = _('A %(resource)s with the name "%(name)s" already exists.')
def __repr__(self):
return self.msg % self.attrs
@ -167,7 +167,7 @@ class AlreadyExists(HorizonException):
return self.msg % self.attrs
def __unicode__(self):
return _(self.msg) % self.attrs
return self.msg % self.attrs
class NotAvailable(HorizonException):

View File

@ -246,7 +246,7 @@ class AddRule(forms.SelfHandlingForm):
backend = api.network.security_group_backend(self.request)
rules_dict = getattr(settings, 'SECURITY_GROUP_RULES', [])
common_rules = [(k, _(rules_dict[k]['name']))
common_rules = [(k, rules_dict[k]['name'])
for k in rules_dict
if rules_dict[k].get('backend', backend) == backend]
common_rules.sort()

View File

@ -62,10 +62,9 @@ exclude = .venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build,panel_
# E128 continuation line under-indented for visual indent
# H307 like imports should be grouped together
# H405 multi line docstring summary not separated with an empty line
# H701 empty localization string
# H803 git commit title should not end with period (disabled on purpose, see bug #1236621)
# H904 Wrap long lines in parentheses instead of a backslash
ignore = E127,E128,H307,H405,H701,H803,H904
ignore = E127,E128,H307,H405,H803,H904
[hacking]
import_exceptions = collections.defaultdict,