diff options
author | rcritten@redhat.com <rcritten@redhat.com> | 2007-08-23 09:44:00 -0400 |
---|---|---|
committer | rcritten@redhat.com <rcritten@redhat.com> | 2007-08-23 09:44:00 -0400 |
commit | 8879ee173ec6814da701464c562471a3c8c5d846 (patch) | |
tree | cb19a6a5ed58e588313b140330f5b2022b153b18 /ipa-server/ipaserver/__init__.py | |
parent | 23508d33b5d9de287411aeead9b3937cc8661093 (diff) | |
download | freeipa-8879ee173ec6814da701464c562471a3c8c5d846.tar.gz freeipa-8879ee173ec6814da701464c562471a3c8c5d846.tar.xz freeipa-8879ee173ec6814da701464c562471a3c8c5d846.zip |
Handle optional arguments by using the value __NONE__ over XML-RPC.
rpcclient.py must call XML-RPC functions with all arguments.
Removed encode_args and decode_args. They were the source of most of the
argument pain. Now opts is alwyas appended to the end of the arguments
so MUST be the last argument in any server-side function (can be None)
Allow the User object to handle unicode data
Small fixes to command-line tools to be friendlier
Broke out get_user() into get_user_by_dn() and get_user_by_uid()
Need to request more than just 'nsAccountLock' attribute when trying to
see if a user is already marked deleted. If it is blank the record
coming back is empty. Add 'uid' to the list to guarantee something coming
back (dn is handled specially)
Added user_container attribute to get_user_* and add_user so the caller
can specify where in the tree the user will be searched for/added.
Added global default value for user_container
Diffstat (limited to 'ipa-server/ipaserver/__init__.py')
-rw-r--r-- | ipa-server/ipaserver/__init__.py | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/ipa-server/ipaserver/__init__.py b/ipa-server/ipaserver/__init__.py index 6d254d6af..6aced0db7 100644 --- a/ipa-server/ipaserver/__init__.py +++ b/ipa-server/ipaserver/__init__.py @@ -20,38 +20,3 @@ # __all__ = ["dsinstance", "krbinstance"] - -# -# Functions common for the XML RPC client and server -# -# Authors: -# Mike McLean <mikem@redhat.com> (from koji) - -# functions for encoding/decoding optional arguments - -def encode_args(*args,**opts): - """The function encodes optional arguments as regular arguments. - - This is used to allow optional arguments in xmlrpc calls - Returns a tuple of args - """ - if opts: - opts['__starstar'] = True - args = args + (opts,) - return args - -def decode_args(*args): - """Decodes optional arguments from a flat argument list - - Complementary to encode_args - Returns a tuple (args,opts) where args is a tuple and opts is a dict - """ - opts = {} - if len(args) > 0: - last = args[-1] - if type(last) == dict and last.get('__starstar',False): - del last['__starstar'] - opts = last - args = args[:-1] - return args,opts - |