summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-06-14 17:51:12 -0400
committerMartin Kosek <mkosek@redhat.com>2011-06-15 14:57:53 +0200
commit23c5af218fe6262757d27de59840fa1bb1610ea8 (patch)
treedee153fc32bfeadec2f533e385e4dcc1d365bb9c /ipaserver
parent613804083d40f6d3b64eeaa8da8a4f5b94cb839d (diff)
downloadfreeipa-23c5af218fe6262757d27de59840fa1bb1610ea8.zip
freeipa-23c5af218fe6262757d27de59840fa1bb1610ea8.tar.gz
freeipa-23c5af218fe6262757d27de59840fa1bb1610ea8.tar.xz
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
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/rpcserver.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py
index 718b761..cf0deed 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):