From 90cc00feab0b7a4be40d945b55c326ef1acecb40 Mon Sep 17 00:00:00 2001 From: Pavel Zuna Date: Mon, 1 Jun 2009 19:02:42 +0200 Subject: Make delegation plugin consistent with plugins2 and use new Crud methods. --- ipalib/plugins/delegation.py | 71 +++++++++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 21 deletions(-) (limited to 'ipalib/plugins/delegation.py') 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) + -- cgit