diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2010-02-19 09:08:16 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2010-02-24 02:47:39 -0700 |
commit | 8c46e09735d076e9689d04936cdeeca6dfd770d3 (patch) | |
tree | 6d4c04028c21ae068f5dfde2357308035693c50c /ipalib/plugins/baseldap.py | |
parent | edf243d83a9c22a19d6dece035865f88d86cacb2 (diff) | |
download | freeipa-8c46e09735d076e9689d04936cdeeca6dfd770d3.tar.gz freeipa-8c46e09735d076e9689d04936cdeeca6dfd770d3.tar.xz freeipa-8c46e09735d076e9689d04936cdeeca6dfd770d3.zip |
Translatable Param.label, Param.doc
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r-- | ipalib/plugins/baseldap.py | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 9aa002a67..e03ac2e5b 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -28,6 +28,7 @@ from ipalib import Flag, List, Str from ipalib.base import NameSpace from ipalib.cli import to_cli, from_cli from ipalib import output +from ipalib.text import _ def validate_add_attribute(ugettext, attr): @@ -129,23 +130,27 @@ class LDAPObject(Object): ) +# Options used by create and update. +_attr_options = ( + Str('addattr*', validate_add_attribute, + cli_name='addattr', + doc=_('Add an attribute/value pair. Format is attr=value'), + exclude='webui', + ), + Str('setattr*', validate_set_attribute, + cli_name='setattr', + doc=_('Set an attribute to an name/value pair. Format is attr=value'), + exclude='webui', + ), +) + + class LDAPCreate(crud.Create): """ Create a new entry in LDAP. """ - takes_options = ( - Str('addattr*', validate_add_attribute, - cli_name='addattr', - doc='Add an attribute/value pair. Format is attr=value', - exclude='webui', - ), - Str('setattr*', validate_set_attribute, - cli_name='setattr', - doc='Set an attribute to an name/value pair. Format is attr=value', - exclude='webui', - ), - ) + takes_options = _attr_options def get_args(self): for key in self.obj.get_ancestor_primary_keys(): @@ -272,18 +277,7 @@ class LDAPUpdate(LDAPQuery, crud.Update): Update an LDAP entry. """ - takes_options = ( - Str('addattr*', validate_add_attribute, - cli_name='addattr', - doc='Add an attribute/value pair. Format is attr=value', - exclude='webui', - ), - Str('setattr*', validate_set_attribute, - cli_name='setattr', - doc='Set an attribute to an name/value pair. Format is attr=value', - exclude='webui', - ), - ) + takes_options = _attr_options def execute(self, *keys, **options): ldap = self.obj.backend |