Fix pep8 errors with pytlint v2.16.0

Change-Id: I2a44e3843dd25b9db387c12f536a084d1fafbcd1
Closes-Bug: #2004538
(cherry picked from commit b1a4f783da)
This commit is contained in:
Rodolfo Alonso Hernandez 2023-02-02 10:34:44 +01:00
parent a09e58a1a2
commit fc15b1c871
2 changed files with 6 additions and 6 deletions

View File

@ -232,7 +232,7 @@ class AttributeInfo(object):
res = validator(res_dict[attr],
attr_vals['validate'][rule])
if res:
msg_dict = dict(attr=attr, reason=res)
msg_dict = {'attr': attr, 'reason': res}
msg = _("Invalid input for %(attr)s. "
"Reason: %(reason)s.") % msg_dict
raise exc_cls(msg)

View File

@ -214,9 +214,9 @@ def _resource_model_map_helper(rs_map, resource, subclass):
raise RuntimeError(_("Model %(sub)s tried to register for API "
"resource %(res)s which conflicts with model "
"%(other)s.") %
dict(sub=subclass,
other=rs_map[resource],
res=resource))
{'sub': subclass,
'other': rs_map[resource],
'res': resource})
rs_map[resource] = subclass
@ -242,8 +242,8 @@ def get_tag_resource_parent_map():
if collection in parent_map:
msg = (_("API parent %(collection)s/%(resource)s for "
"model %(subclass)s is already registered.") %
dict(collection=collection, resource=resource,
subclass=subclass))
{'collection': collection, 'resource': resource,
'subclass': subclass})
raise RuntimeError(msg)
parent_map[collection] = resource
return parent_map