mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user