summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/automember.py8
-rw-r--r--ipalib/plugins/baseldap.py18
-rw-r--r--ipalib/plugins/config.py4
-rw-r--r--ipalib/plugins/sudorule.py8
4 files changed, 20 insertions, 18 deletions
diff --git a/ipalib/plugins/automember.py b/ipalib/plugins/automember.py
index 3b652185..fabc9bb3 100644
--- a/ipalib/plugins/automember.py
+++ b/ipalib/plugins/automember.py
@@ -185,7 +185,7 @@ class automember(LDAPObject):
try:
(gdn, entry_attrs) = ldap.get_entry(dn, [])
except errors.NotFound:
- raise errors.NotFound(reason=_(u'Group: %s not found!' % groupname))
+ raise errors.NotFound(reason=_(u'Group: %s not found!') % groupname)
return gdn
def get_dn(self, *keys, **options):
@@ -212,7 +212,7 @@ class automember(LDAPObject):
if obj is not None:
return obj
else:
- raise errors.NotFound(reason=_('%s is not a valid attribute.' % attr))
+ raise errors.NotFound(reason=_('%s is not a valid attribute.') % attr)
api.register(automember)
@@ -283,7 +283,7 @@ class automember_add_condition(LDAPUpdate):
try:
(tdn, test_attrs) = ldap.get_entry(dn, [])
except errors.NotFound:
- raise errors.NotFound(reason=_(u'Auto member rule: %s not found!' % keys[0]))
+ raise errors.NotFound(reason=_(u'Auto member rule: %s not found!') % keys[0])
# Define container key
key = options['key']
# Check to see if the attribute is valid
@@ -369,7 +369,7 @@ class automember_remove_condition(LDAPUpdate):
try:
(tdn, test_attrs) = ldap.get_entry(dn, [])
except errors.NotFound:
- raise errors.NotFound(reason=_(u'Auto member rule: %s not found!' % keys[0]))
+ raise errors.NotFound(reason=_(u'Auto member rule: %s not found!') % keys[0])
# Define container key
type_attr_default = {'group': 'manager', 'hostgroup': 'fqdn'}
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 66ba4eff..66339cca 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -1644,8 +1644,8 @@ class LDAPSearch(BaseLDAPCommand, crud.Search):
Retrieve all LDAP entries matching the given criteria.
"""
member_attributes = []
- member_param_incl_doc = _('Search for %s with these %s %s.')
- member_param_excl_doc = _('Search for %s without these %s %s.')
+ member_param_incl_doc = _('Search for %(searched_object)s with these %(relationship)s %(ldap_object)s.')
+ member_param_excl_doc = _('Search for %(searched_object)s without these %(relationship)s %(ldap_object)s.')
# pointer to function for entries sorting
# if no function is assigned the entries are sorted by their primary key value
@@ -1684,18 +1684,20 @@ class LDAPSearch(BaseLDAPCommand, crud.Search):
relationship = self.obj.relationships.get(
attr, ['member', '', 'no_']
)
- doc = self.member_param_incl_doc % (
- self.obj.object_name_plural, relationship[0].lower(),
- ldap_obj.object_name_plural
+ doc = self.member_param_incl_doc % dict(
+ searched_object=self.obj.object_name_plural,
+ relationship=relationship[0].lower(),
+ ldap_object=ldap_obj.object_name_plural
)
name = '%s%s' % (relationship[1], to_cli(ldap_obj_name))
yield Str(
'%s*' % name, cli_name='%ss' % name, doc=doc,
label=ldap_obj.object_name, csv=True
)
- doc = self.member_param_excl_doc % (
- self.obj.object_name_plural, relationship[0].lower(),
- ldap_obj.object_name_plural
+ doc = self.member_param_excl_doc % dict(
+ searched_object=self.obj.object_name_plural,
+ relationship=relationship[0].lower(),
+ ldap_object=ldap_obj.object_name_plural
)
name = '%s%s' % (relationship[2], to_cli(ldap_obj_name))
yield Str(
diff --git a/ipalib/plugins/config.py b/ipalib/plugins/config.py
index 1455771d..ecf42464 100644
--- a/ipalib/plugins/config.py
+++ b/ipalib/plugins/config.py
@@ -241,8 +241,8 @@ class config_mod(LDAPUpdate):
continue
if obj_attr not in new_allowed_attrs:
raise errors.ValidationError(name=attr,
- error=_('%s default attribute %s would not be allowed!') \
- % (obj, obj_attr))
+ error=_('%(obj)s default attribute %(attr)s would not be allowed!') \
+ % dict(obj=obj, attr=obj_attr))
if 'ipaselinuxusermapdefault' in options and options['ipaselinuxusermapdefault'] is None:
raise errors.ValidationError(name='ipaselinuxusermapdefault',
diff --git a/ipalib/plugins/sudorule.py b/ipalib/plugins/sudorule.py
index 05fba455..ff7b756a 100644
--- a/ipalib/plugins/sudorule.py
+++ b/ipalib/plugins/sudorule.py
@@ -587,8 +587,8 @@ class sudorule_add_option(LDAPQuery):
return dict(result=entry_attrs)
def output_for_cli(self, textui, result, cn, **options):
- textui.print_dashed(_('Added option "%s" to Sudo Rule "%s"') % \
- (options['ipasudoopt'], cn))
+ textui.print_dashed(_('Added option "%(option)s" to Sudo Rule "%(rule)s"') % \
+ dict(option=options['ipasudoopt'], rule=cn))
super(sudorule_add_option, self).output_for_cli(textui, result, cn, options)
@@ -642,8 +642,8 @@ class sudorule_remove_option(LDAPQuery):
return dict(result=entry_attrs)
def output_for_cli(self, textui, result, cn, **options):
- textui.print_dashed(_('Removed option "%s" from Sudo Rule "%s"') % \
- (options['ipasudoopt'], cn))
+ textui.print_dashed(_('Removed option "%(option)s" from Sudo Rule "%(rule)s"') % \
+ dict(option=options['ipasudoopt'], rule=cn))
super(sudorule_remove_option, self).output_for_cli(textui, result, cn, options)
api.register(sudorule_remove_option)