diff --git a/dirsrvtests/tests/suites/healthcheck/health_config_test.py b/dirsrvtests/tests/suites/healthcheck/health_config_test.py index 94708562f..f09bc8bb8 100644 --- a/dirsrvtests/tests/suites/healthcheck/health_config_test.py +++ b/dirsrvtests/tests/suites/healthcheck/health_config_test.py @@ -167,6 +167,7 @@ def test_healthcheck_RI_plugin_missing_indexes(topology_st): MEMBER_DN = 'cn=member,cn=index,cn=userroot,cn=ldbm database,cn=plugins,cn=config' standalone = topology_st.standalone + standalone.config.set("nsslapd-accesslog-logbuffering", "on") log.info('Enable RI plugin') plugin = ReferentialIntegrityPlugin(standalone) @@ -214,6 +215,7 @@ def test_healthcheck_MO_plugin_missing_indexes(topology_st): MO_GROUP_ATTR = 'creatorsname' standalone = topology_st.standalone + standalone.config.set("nsslapd-accesslog-logbuffering", "on") log.info('Enable MO plugin') plugin = MemberOfPlugin(standalone) @@ -280,6 +282,7 @@ def test_healthcheck_MO_plugin_substring_index(topology_st): UNIQUE_MEMBER_DN = 'cn=uniquemember,cn=index,cn=userroot,cn=ldbm database,cn=plugins,cn=config' standalone = topology_st.standalone + standalone.config.set("nsslapd-accesslog-logbuffering", "on") log.info('Enable MO plugin') plugin = MemberOfPlugin(standalone) diff --git a/src/lib389/lib389/lint.py b/src/lib389/lib389/lint.py index 61f696e51..460bf64fc 100644 --- a/src/lib389/lib389/lint.py +++ b/src/lib389/lib389/lint.py @@ -279,7 +279,7 @@ from the large group can be slow. """, - 'fix': """If not required you can remove the substring index type using dsconf: + 'fix': """If not required, you can remove the substring index type using dsconf: # dsconf slapd-YOUR_INSTANCE backend index set --attr=ATTR BACKEND --del-type=sub """ diff --git a/src/lib389/lib389/plugins.py b/src/lib389/lib389/plugins.py index 0a3763096..31bbfa502 100644 --- a/src/lib389/lib389/plugins.py +++ b/src/lib389/lib389/plugins.py @@ -831,7 +831,7 @@ def _lint_member_substring_index(self): if self.status(): from lib389.backend import Backends backends = Backends(self._instance).list() - attrs = self.get_attr_vals_utf8_l("memberofgroupattr") + membership_attrs = ['member', 'uniquemember'] container = self.get_attr_val_utf8_l("nsslapd-plugincontainerscope") for backend in backends: suffix = backend.get_attr_val_utf8_l('nsslapd-suffix') @@ -844,17 +844,12 @@ def _lint_member_substring_index(self): # skip this backend that is not in the scope continue indexes = backend.get_indexes() - membership_attrs = ['member', 'uniquemember'] for attr in membership_attrs: report = copy.deepcopy(DSMOLE0002) try: index = indexes.get(attr) types = index.get_attr_vals_utf8_l("nsIndexType") - valid = True if "sub" in types: - valid = False - - if not valid: report['detail'] = report['detail'].replace('ATTR', attr) report['detail'] = report['detail'].replace('BACKEND', suffix) report['fix'] = report['fix'].replace('ATTR', attr) @@ -864,8 +859,8 @@ def _lint_member_substring_index(self): report['items'].append(attr) report['check'] = f'attr:substring_index' yield report - except: - pass + except KeyError: + continue def get_attr(self): """Get memberofattr attribute"""