Fix formatted translations of error messages in serverroles plugin

For now formatting is applied for bare messages before translating.
This breaks python-brace-format and message becomes untranslatable
at all.

Fixes: https://pagure.io/freeipa/issue/7586
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Stanislav Levin 2018-06-20 13:01:00 +03:00 committed by Christian Heimes
parent 6f245db8ea
commit 1dfdbfd8bf

View File

@ -79,7 +79,7 @@ class serverroles(Backend):
return self.role_names[key]
except KeyError:
raise errors.NotFound(
reason=_("{role}: role not found".format(role=role_name)))
reason=_("{role}: role not found").format(role=role_name))
def _get_enabled_masters(self, role_name):
result = {}
@ -164,4 +164,4 @@ class serverroles(Backend):
self.attributes[attr].set(self.api, value)
except KeyError:
raise errors.NotFound(
reason=_('{attr}: no such attribute'.format(attr=attr)))
reason=_('{attr}: no such attribute').format(attr=attr))