summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2012-02-10 05:27:24 -0500
committerMartin Kosek <mkosek@redhat.com>2012-02-14 19:08:40 +0100
commit528a94f839c2fa17d2453860442d654250149ff7 (patch)
tree61a4b328c41c3a9bc960a7f14fc5ff9536363eb3 /ipalib/plugins
parent2755709f2e1d484d5f51bc10ad4d1f654c87dc2d (diff)
downloadfreeipa-528a94f839c2fa17d2453860442d654250149ff7.tar.gz
freeipa-528a94f839c2fa17d2453860442d654250149ff7.tar.xz
freeipa-528a94f839c2fa17d2453860442d654250149ff7.zip
Internationalization for HBAC and ipalib.output
* hbacrule: Internationalize HBAC rule "all" category exceptions https://fedorahosted.org/freeipa/ticket/2267 * hbactest: Use internationalized names (doc) instead of names for output items Also don't convert result to bool, `not` does it implicitly * ipalib.output: Internationalize descriptions of some standard entries
Diffstat (limited to 'ipalib/plugins')
-rw-r--r--ipalib/plugins/hbacrule.py8
-rw-r--r--ipalib/plugins/hbactest.py6
2 files changed, 7 insertions, 7 deletions
diff --git a/ipalib/plugins/hbacrule.py b/ipalib/plugins/hbacrule.py
index c83305738..466648556 100644
--- a/ipalib/plugins/hbacrule.py
+++ b/ipalib/plugins/hbacrule.py
@@ -265,13 +265,13 @@ class hbacrule_mod(LDAPUpdate):
self.obj.handle_not_found(*keys)
if is_all(options, 'usercategory') and 'memberuser' in entry_attrs:
- raise errors.MutuallyExclusiveError(reason="user category cannot be set to 'all' while there are allowed users")
+ raise errors.MutuallyExclusiveError(reason=_("user category cannot be set to 'all' while there are allowed users"))
if is_all(options, 'hostcategory') and 'memberhost' in entry_attrs:
- raise errors.MutuallyExclusiveError(reason="host category cannot be set to 'all' while there are allowed hosts")
+ raise errors.MutuallyExclusiveError(reason=_("host category cannot be set to 'all' while there are allowed hosts"))
if is_all(options, 'sourcehostcategory') and 'sourcehost' in entry_attrs:
- raise errors.MutuallyExclusiveError(reason="sourcehost category cannot be set to 'all' while there are allowed source hosts")
+ raise errors.MutuallyExclusiveError(reason=_("sourcehost category cannot be set to 'all' while there are allowed sourcehosts"))
if is_all(options, 'servicecategory') and 'memberservice' in entry_attrs:
- raise errors.MutuallyExclusiveError(reason="service category cannot be set to 'all' while there are allowed services")
+ raise errors.MutuallyExclusiveError(reason=_("service category cannot be set to 'all' while there are allowed services"))
return dn
api.register(hbacrule_mod)
diff --git a/ipalib/plugins/hbactest.py b/ipalib/plugins/hbactest.py
index 92b7145a3..b81dca3de 100644
--- a/ipalib/plugins/hbactest.py
+++ b/ipalib/plugins/hbactest.py
@@ -359,7 +359,7 @@ class hbactest(Command):
if res == pyhbac.HBAC_EVAL_DENY:
notmatched_rules.append(ipa_rule.name)
if warning_flag:
- warning_rules.append(u'Sourcehost value of rule "%s" is ignored' % (ipa_rule.name))
+ warning_rules.append(_(u'Sourcehost value of rule "%s" is ignored') % (ipa_rule.name))
except pyhbac.HbacError as (code, rule_name):
if code == pyhbac.HBAC_EVAL_ERROR:
error_rules.append(rule_name)
@@ -402,7 +402,7 @@ class hbactest(Command):
continue
result = output[o]
if isinstance(result, (list, tuple)):
- textui.print_attribute(outp.name, result, '%s: %s', 1, True)
+ textui.print_attribute(unicode(outp.doc), result, '%s: %s', 1, True)
elif isinstance(result, (unicode, bool)):
if o == 'summary':
textui.print_summary(result)
@@ -410,6 +410,6 @@ class hbactest(Command):
textui.print_indented(result)
# Propagate integer value for result. It will give proper command line result for scripts
- return int(not bool(output['value']))
+ return int(not output['value'])
api.register(hbactest)