summaryrefslogtreecommitdiffstats
path: root/ipalib/frontend.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-01-22 15:41:54 -0700
committerRob Crittenden <rcritten@redhat.com>2009-02-03 15:29:01 -0500
commit24b6cb89d443384cb432f01265c45bc18d9cf2fc (patch)
tree50aa6e4b2ce4863d018644026c34085347263c74 /ipalib/frontend.py
parent9f48612a56b6e760aa06a9af2071f1b50f413f27 (diff)
downloadfreeipa-24b6cb89d443384cb432f01265c45bc18d9cf2fc.tar.gz
freeipa-24b6cb89d443384cb432f01265c45bc18d9cf2fc.tar.xz
freeipa-24b6cb89d443384cb432f01265c45bc18d9cf2fc.zip
Further migration toward new xmlrcp code; fixed problem with unicode Fault.faultString; fixed problem where ServerProxy method was not called correctly
Diffstat (limited to 'ipalib/frontend.py')
-rw-r--r--ipalib/frontend.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index 2277c7a09..6efccbb4d 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -96,14 +96,14 @@ class Command(plugable.Plugin):
If not in a server context, the call will be forwarded over
XML-RPC and the executed an the nearest IPA server.
"""
- self.debug(make_repr(self.name, *args, **options))
params = self.args_options_2_params(*args, **options)
params = self.normalize(**params)
params = self.convert(**params)
params.update(self.get_default(**params))
self.validate(**params)
(args, options) = self.params_2_args_options(**params)
- self.debug(make_repr(self.name, *args, **options))
+ # FIXME: don't log passords!
+ self.info(make_repr(self.name, *args, **options))
result = self.run(*args, **options)
self.debug('%s result: %r', self.name, result)
return result
@@ -200,6 +200,11 @@ class Command(plugable.Plugin):
(k, self.params[k].convert(v)) for (k, v) in kw.iteritems()
)
+ def __convert_iter(self, kw):
+ for param in self.params():
+ if kw.get(param.name, None) is None:
+ continue
+
def get_default(self, **kw):
"""
Return a dictionary of defaults for all missing required values.
@@ -245,7 +250,7 @@ class Command(plugable.Plugin):
elif param.required:
raise errors.RequirementError(param.name)
- def run(self, *args, **kw):
+ def run(self, *args, **options):
"""
Dispatch to `Command.execute` or `Command.forward`.
@@ -258,11 +263,8 @@ class Command(plugable.Plugin):
performs is executed remotely.
"""
if self.api.env.in_server:
- target = self.execute
- else:
- target = self.forward
- object.__setattr__(self, 'run', target)
- return target(*args, **kw)
+ return self.execute(*args, **options)
+ return self.forward(*args, **options)
def execute(self, *args, **kw):
"""
@@ -283,7 +285,7 @@ class Command(plugable.Plugin):
"""
Forward call over XML-RPC to this same command on server.
"""
- return self.Backend.xmlrpc.forward_call(self.name, *args, **kw)
+ return self.Backend.xmlclient.forward(self.name, *args, **kw)
def finalize(self):
"""