diff options
author | Pavel Zuna <pzuna@redhat.com> | 2009-06-01 19:02:42 +0200 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-06-02 16:20:44 -0400 |
commit | 90cc00feab0b7a4be40d945b55c326ef1acecb40 (patch) | |
tree | 75f23869b22a280683b56cba65ab25cc1232bf9b | |
parent | 66d291001a55669a546f427b2a1d63c7d3099b48 (diff) | |
download | freeipa-90cc00feab0b7a4be40d945b55c326ef1acecb40.tar.gz freeipa-90cc00feab0b7a4be40d945b55c326ef1acecb40.tar.xz freeipa-90cc00feab0b7a4be40d945b55c326ef1acecb40.zip |
Make delegation plugin consistent with plugins2 and use new Crud methods.
-rw-r--r-- | ipalib/plugins/delegation.py | 71 |
1 files changed, 50 insertions, 21 deletions
diff --git a/ipalib/plugins/delegation.py b/ipalib/plugins/delegation.py index 4c207b338..efbb82292 100644 --- a/ipalib/plugins/delegation.py +++ b/ipalib/plugins/delegation.py @@ -16,49 +16,78 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - """ -Frontend plugins for delegations. +Delegations """ -from ipalib import frontend -from ipalib import crud -from ipalib.frontend import Param +from ipalib import api, crud +from ipalib import Object +from ipalib import Str from ipalib import api -class delegation(frontend.Object): +class delegation(Object): """ Delegation object. """ takes_params = ( - 'attributes', - 'source', - 'target', - Param('name', primary_key=True) + Str('name', + cli_name='name', + doc='name', + primary_key=True + ), + List('attributes', + cli_name='attributes', + doc='comma-separated list of attributes', + ), + Str('source', + cli_name='source', + doc='source', + ), + Str('target', + cli_name='target', + doc='target', + ), ) + api.register(delegation) -class delegation_add(crud.Add): - 'Add a new delegation.' +class delegation_create(crud.Create): + """ + Create delegation. + """ + api.register(delegation_add) -class delegation_del(crud.Del): - 'Delete an existing delegation.' -api.register(delegation_del) +class delegation_delete(crud.Delete): + """ + Delete delegation. + """ + +api.register(delegation_delete) + +class delegation_mod(crud.Update): + """ + Modify delegation. + """ -class delegation_mod(crud.Mod): - 'Edit an existing delegation.' api.register(delegation_mod) -class delegation_find(crud.Find): - 'Search for a delegation.' +class delegation_find(crud.Search): + """ + Search for delegations. + """ + api.register(delegation_find) -class delegation_show(crud.Get): - 'Examine an existing delegation.' +class delegation_show(crud.Retrieve): + """ + Display delegation. + """ + api.register(delegation_show) + |