diff options
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 6d254d6a..6aced0db 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 - |