mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 07:33:27 -06:00
specify type of exceeded limit when warning about truncated search results
API commands inheriting from LDAPSearch should mention which limit was exceeded in the warning message sent with truncated results. https://fedorahosted.org/freeipa/ticket/5677 Reviewed-By: Petr Spacek <pspacek@redhat.com>
This commit is contained in:
parent
1f0959735f
commit
62bb478e11
@ -338,7 +338,7 @@ class SearchResultTruncated(PublicMessage):
|
||||
|
||||
errno = 13017
|
||||
type = "warning"
|
||||
format = _("Search result has been truncated to configured search limit.")
|
||||
format = _("Search result has been truncated: %(reason)s")
|
||||
|
||||
|
||||
class BrokenTrust(PublicMessage):
|
||||
|
@ -2104,8 +2104,11 @@ class LDAPSearch(BaseLDAPCommand, crud.Search):
|
||||
truncated=bool(truncated),
|
||||
)
|
||||
|
||||
if truncated:
|
||||
add_message(options['version'], result, SearchResultTruncated())
|
||||
try:
|
||||
ldap.handle_truncated_result(truncated)
|
||||
except errors.LimitsExceeded as e:
|
||||
add_message(options['version'], result, SearchResultTruncated(
|
||||
reason=e))
|
||||
|
||||
return result
|
||||
|
||||
|
@ -525,8 +525,8 @@ class test_old_permission(Declarative):
|
||||
},
|
||||
],
|
||||
messages=({
|
||||
'message': (u'Search result has been truncated to '
|
||||
'configured search limit.'),
|
||||
'message': (u'Search result has been truncated: '
|
||||
u'Configured size limit exceeded'),
|
||||
'code': 13017,
|
||||
'type': u'warning',
|
||||
'name': u'SearchResultTruncated'
|
||||
@ -585,8 +585,8 @@ class test_old_permission(Declarative):
|
||||
api.env.basedn)) and
|
||||
'ipapermission' in res['objectclass']],
|
||||
messages=({
|
||||
'message': (u'Search result has been truncated to '
|
||||
'configured search limit.'),
|
||||
'message': (u'Search result has been truncated: '
|
||||
u'Configured size limit exceeded'),
|
||||
'code': 13017,
|
||||
'type': u'warning',
|
||||
'name': u'SearchResultTruncated'
|
||||
|
@ -818,8 +818,8 @@ class test_permission(Declarative):
|
||||
],
|
||||
messages=(
|
||||
{
|
||||
'message': (u'Search result has been truncated to '
|
||||
'configured search limit.'),
|
||||
'message': (u'Search result has been truncated: '
|
||||
u'Configured size limit exceeded'),
|
||||
'code': 13017,
|
||||
'type': u'warning',
|
||||
'name': u'SearchResultTruncated'
|
||||
@ -882,8 +882,8 @@ class test_permission(Declarative):
|
||||
'ipapermission' in res['objectclass']],
|
||||
messages=(
|
||||
{
|
||||
'message': (u'Search result has been truncated to '
|
||||
'configured search limit.'),
|
||||
'message': (u'Search result has been truncated: '
|
||||
u'Configured size limit exceeded'),
|
||||
'code': 13017,
|
||||
'type': u'warning',
|
||||
'name': u'SearchResultTruncated'
|
||||
|
Loading…
Reference in New Issue
Block a user