diff --git a/neutron_lib/api/attributes.py b/neutron_lib/api/attributes.py index 4eb30acc8..0fd9fdcde 100644 --- a/neutron_lib/api/attributes.py +++ b/neutron_lib/api/attributes.py @@ -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) diff --git a/neutron_lib/db/standard_attr.py b/neutron_lib/db/standard_attr.py index 8ab5a8b9a..2a605a6e4 100644 --- a/neutron_lib/db/standard_attr.py +++ b/neutron_lib/db/standard_attr.py @@ -213,9 +213,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 @@ -241,8 +241,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