diff --git a/ipalib/messages.py b/ipalib/messages.py index 872b455c1..c37cceb3f 100644 --- a/ipalib/messages.py +++ b/ipalib/messages.py @@ -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): diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 0eae45dbd..dc61fe454 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -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 diff --git a/ipatests/test_xmlrpc/test_old_permission_plugin.py b/ipatests/test_xmlrpc/test_old_permission_plugin.py index 09f43fee8..1af76f6a6 100644 --- a/ipatests/test_xmlrpc/test_old_permission_plugin.py +++ b/ipatests/test_xmlrpc/test_old_permission_plugin.py @@ -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' diff --git a/ipatests/test_xmlrpc/test_permission_plugin.py b/ipatests/test_xmlrpc/test_permission_plugin.py index 8026e8436..df5498a61 100644 --- a/ipatests/test_xmlrpc/test_permission_plugin.py +++ b/ipatests/test_xmlrpc/test_permission_plugin.py @@ -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'