From 6fe61010a405fd1bb6f6733223dd295c2ecd64d1 Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Nov 26 2018 17:36:50 +0000 Subject: Ticket 49927 - dsctl db2index does not work Description: When you don't specify any attributes to index, then all attributes should be reindexed. This is accomplished by using "ns-slapd upgradedb" but we were not using the correct command line options for this to work. https://pagure.io/389-ds-base/issue/49927 Reviewed by: spichugi(Thanks!) --- diff --git a/src/lib389/lib389/__init__.py b/src/lib389/lib389/__init__.py index 0355259..ce205e7 100644 --- a/src/lib389/lib389/__init__.py +++ b/src/lib389/lib389/__init__.py @@ -2961,22 +2961,22 @@ class DirSrv(SimpleLDAPObject, object): self.log.error("db2index: missing required backend name or suffix") return False - cmd = [prog,] + cmd = [prog, ] if attrs or vlvTag: cmd.append('db2index') + if bename: + cmd.append('-n') + cmd.append(bename) else: cmd.append('upgradedb') cmd.append('-a') now = datetime.now().isoformat() cmd.append(os.path.join(self.get_bak_dir(), 'reindex_%s' % now)) + cmd.append('-f') cmd.append('-D') cmd.append(self.get_config_dir()) - if bename: - cmd.append('-n') - cmd.append(bename) - # Can only use suffiix in attr only mode. if suffixes and (attrs or vlvTag): for suffix in suffixes: