diff options
author | Rob Crittenden <rcritten@redhat.com> | 2008-09-25 23:53:53 -0400 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-30 19:37:35 -0600 |
commit | b965e558b5def14c6416beb36dc790cca96c3724 (patch) | |
tree | 6f1c0097f46b19f7a8fd2b76763d783c36813fd1 /ipalib/plugins | |
parent | afdc72103847fc27efd00f8cc97a7320909ff6a0 (diff) | |
download | freeipa-b965e558b5def14c6416beb36dc790cca96c3724.tar.gz freeipa-b965e558b5def14c6416beb36dc790cca96c3724.tar.xz freeipa-b965e558b5def14c6416beb36dc790cca96c3724.zip |
Rebase XML-RPC client and server
Fix error handling in server to return exceptions generated in library code
Diffstat (limited to 'ipalib/plugins')
-rw-r--r-- | ipalib/plugins/example.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ipalib/plugins/example.py b/ipalib/plugins/example.py index c565d6785..c7d161600 100644 --- a/ipalib/plugins/example.py +++ b/ipalib/plugins/example.py @@ -26,7 +26,8 @@ from ipalib import frontend from ipalib import crud from ipalib.frontend import Param from ipalib import api - +from ipalib import servercore +import ldap class user(frontend.Object): 'User object' @@ -78,6 +79,8 @@ api.register(envtest) # Register some methods for the 'user' object: class user_add(crud.Add): 'Add a new user.' + def execute(self, *args, **kw): + return 1 api.register(user_add) class user_del(crud.Del): @@ -90,6 +93,10 @@ api.register(user_mod) class user_find(crud.Find): 'Search the users.' + def execute(self, *args, **kw): + uid=args[0] + result = servercore.get_sub_entry(servercore.basedn, "uid=%s" % uid, ["*"]) + return result api.register(user_find) class user_show(crud.Get): |