mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix batch command error reporting
The Batch command did not report errors correctly: it reported the text of *all* errors, not just PublicError, used unicode(e) instead of e.strerror (which results in incorrect i18n), and only reported the text of error messages, not their type and code. Fix these problems. Update tests. https://fedorahosted.org/freeipa/ticket/2874 https://fedorahosted.org/freeipa/ticket/2901
This commit is contained in:
committed by
Martin Kosek
parent
e494650b2c
commit
5f69a06d1a
@@ -121,8 +121,16 @@ class test_batch(Declarative):
|
||||
expected=dict(
|
||||
count=2,
|
||||
results=[
|
||||
dict(error=u'%s: group not found' % group1),
|
||||
dict(error=u'%s: group not found' % group1),
|
||||
dict(
|
||||
error=u'%s: group not found' % group1,
|
||||
error_name=u'NotFound',
|
||||
error_code=4001,
|
||||
),
|
||||
dict(
|
||||
error=u'%s: group not found' % group1,
|
||||
error_name=u'NotFound',
|
||||
error_code=4001,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -137,7 +145,11 @@ class test_batch(Declarative):
|
||||
expected=dict(
|
||||
count=2,
|
||||
results=deepequal_list(
|
||||
dict(error=u'%s: group not found' % group1),
|
||||
dict(
|
||||
error=u'%s: group not found' % group1,
|
||||
error_name=u'NotFound',
|
||||
error_code=4001,
|
||||
),
|
||||
dict(
|
||||
value=group1,
|
||||
summary=u'Added group "testgroup1"',
|
||||
@@ -180,13 +192,41 @@ class test_batch(Declarative):
|
||||
expected=dict(
|
||||
count=7,
|
||||
results=deepequal_list(
|
||||
dict(error=u"unknown command 'nonexistent_ipa_command'"),
|
||||
dict(error=u"unknown command 'user-del'"),
|
||||
dict(error=u"'method' is required"),
|
||||
dict(error=u"'params' is required"),
|
||||
dict(error=u"'givenname' is required"),
|
||||
dict(error=u"'description' is required"),
|
||||
dict(error=Fuzzy(u"invalid 'gid'.*")),
|
||||
dict(
|
||||
error=u"unknown command 'nonexistent_ipa_command'",
|
||||
error_name=u'CommandError',
|
||||
error_code=905,
|
||||
),
|
||||
dict(
|
||||
error=u"unknown command 'user-del'",
|
||||
error_name=u'CommandError',
|
||||
error_code=905,
|
||||
),
|
||||
dict(
|
||||
error=u"'method' is required",
|
||||
error_name=u'RequirementError',
|
||||
error_code=3007,
|
||||
),
|
||||
dict(
|
||||
error=u"'params' is required",
|
||||
error_name=u'RequirementError',
|
||||
error_code=3007,
|
||||
),
|
||||
dict(
|
||||
error=u"'givenname' is required",
|
||||
error_name=u'RequirementError',
|
||||
error_code=3007,
|
||||
),
|
||||
dict(
|
||||
error=u"'description' is required",
|
||||
error_name=u'RequirementError',
|
||||
error_code=3007,
|
||||
),
|
||||
dict(
|
||||
error=Fuzzy(u"invalid 'gid'.*"),
|
||||
error_name=u'ConversionError',
|
||||
error_code=3008,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user