From 23c5af218fe6262757d27de59840fa1bb1610ea8 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Tue, 14 Jun 2011 17:51:12 -0400 Subject: Don't let a JSON error get lost in cascading errors. If a JSON decoding error was found we were still trying to call the XML-RPC function, losing the original error. https://fedorahosted.org/freeipa/ticket/1322 --- ipaserver/rpcserver.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py index 718b76180..cf0deed8c 100644 --- a/ipaserver/rpcserver.py +++ b/ipaserver/rpcserver.py @@ -227,11 +227,12 @@ class WSGIExecutioner(Executioner): error = InternalError() finally: os.environ['LANG'] = lang - params = self.Command[name].args_options_2_params(*args, **options) - if error: - self.info('%s: %s(%s): %s', context.principal, name, ', '.join(self.Command[name]._repr_iter(**params)), e.__class__.__name__) - else: - self.info('%s: %s(%s): SUCCESS', context.principal, name, ', '.join(self.Command[name]._repr_iter(**params))) + if error is None: + params = self.Command[name].args_options_2_params(*args, **options) + if error: + self.info('%s: %s(%s): %s', context.principal, name, ', '.join(self.Command[name]._repr_iter(**params)), e.__class__.__name__) + else: + self.info('%s: %s(%s): SUCCESS', context.principal, name, ', '.join(self.Command[name]._repr_iter(**params))) return self.marshal(result, error, _id) def simple_unmarshal(self, environ): -- cgit