This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.1
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.1 by this push:
new c6bfccc Issue 50780 - More CLI fixes
c6bfccc is described below
commit c6bfcccad6225fd6245ef2c315037acb853d798f
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Thu Dec 19 14:53:46 2019 -0500
Issue 50780 - More CLI fixes
Description: Harden the get RUV/agmtMaxCSN in case DB is missing
the ruv/tombstone entry
relates:
https://pagure.io/389-ds-base/issue/50780
Reviewed by: firstyear(Thanks!)
---
src/lib389/lib389/replica.py | 41 ++++++++++++++++++++++++-----------------
1 file changed, 24 insertions(+), 17 deletions(-)
diff --git a/src/lib389/lib389/replica.py b/src/lib389/lib389/replica.py
index ba58416..79ebd98 100644
--- a/src/lib389/lib389/replica.py
+++ b/src/lib389/lib389/replica.py
@@ -1542,16 +1542,19 @@ class Replica(DSLdapObject):
:raises: LDAPError
"""
self._populate_suffix()
-
- ent = self._instance.search_ext_s(
- base=self._suffix,
- scope=ldap.SCOPE_SUBTREE,
-
filterstr='(&(nsuniqueid=ffffffff-ffffffff-ffffffff-ffffffff)(objectclass=nstombstone))',
- attrlist=['nsds50ruv'],
- serverctrls=self._server_controls, clientctrls=self._client_controls,
- escapehatch='i am sure')[0]
-
- data = ensure_list_str(ent.getValues('nsds50ruv'))
+ data = []
+ try:
+ ent = self._instance.search_ext_s(
+ base=self._suffix,
+ scope=ldap.SCOPE_SUBTREE,
+
filterstr='(&(nsuniqueid=ffffffff-ffffffff-ffffffff-ffffffff)(objectclass=nstombstone))',
+ attrlist=['nsds50ruv'],
+ serverctrls=self._server_controls, clientctrls=self._client_controls,
+ escapehatch='i am sure')[0]
+ data = ensure_list_str(ent.getValues('nsds50ruv'))
+ except IndexError:
+ # There is no ruv entry, it's okay
+ pass
return RUV(data)
@@ -1572,13 +1575,17 @@ class Replica(DSLdapObject):
"""
self._populate_suffix()
- ent = self._instance.search_ext_s(
- base=self._suffix,
- scope=ldap.SCOPE_SUBTREE,
-
filterstr='(&(nsuniqueid=ffffffff-ffffffff-ffffffff-ffffffff)(objectclass=nstombstone))',
- attrlist=['nsds5agmtmaxcsn'],
- serverctrls=self._server_controls, clientctrls=self._client_controls,
- escapehatch='i am sure')[0]
+ try:
+ ent = self._instance.search_ext_s(
+ base=self._suffix,
+ scope=ldap.SCOPE_SUBTREE,
+
filterstr='(&(nsuniqueid=ffffffff-ffffffff-ffffffff-ffffffff)(objectclass=nstombstone))',
+ attrlist=['nsds5agmtmaxcsn'],
+ serverctrls=self._server_controls, clientctrls=self._client_controls,
+ escapehatch='i am sure')[0]
+ except IndexError:
+ # there is no ruv entry, it's okay
+ return []
return ensure_list_str(ent.getValues('nsds5agmtmaxcsn'))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.