diff options
author | Martin Kosek <mkosek@redhat.com> | 2011-10-11 10:54:34 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2011-10-11 15:15:15 +0200 |
commit | 070bc7f725dc33e61bf421b9973292721ae6fbfa (patch) | |
tree | ca887167f6d7074c6bd19bf35af7777cc3eef168 /ipaserver | |
parent | 2916ad4ac2ba8bee3cd66e6c6f30e3cdcb913b06 (diff) | |
download | freeipa-070bc7f725dc33e61bf421b9973292721ae6fbfa.tar.gz freeipa-070bc7f725dc33e61bf421b9973292721ae6fbfa.tar.xz freeipa-070bc7f725dc33e61bf421b9973292721ae6fbfa.zip |
Fix dnszone-add name_from_ip server validation
Ticket 1627 contained a (temporary hack-ish) fix for dnszone-add
name_from_ip validation which works fine for CLI. However, when
the command is not proceeded via CLI and sent directly to the
RPC server, the server throws Internal Server Error.
Make sure that the server returns a reasonable error. Also implement
2 unit cases testing this option
https://fedorahosted.org/freeipa/ticket/1941
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/rpcserver.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py index 39cdbcc7f..35a109262 100644 --- a/ipaserver/rpcserver.py +++ b/ipaserver/rpcserver.py @@ -231,7 +231,14 @@ class WSGIExecutioner(Executioner): finally: os.environ['LANG'] = lang if name: - params = self.Command[name].args_options_2_params(*args, **options) + try: + params = self.Command[name].args_options_2_params(*args, **options) + except Exception, e: + self.info( + 'exception %s caught when converting options: %s', e.__class__.__name__, str(e) + ) + # get at least some context of what is going on + params = options if error: self.info('%s: %s(%s): %s', context.principal, name, ', '.join(self.Command[name]._repr_iter(**params)), e.__class__.__name__) else: |