#50796 Issue 50780 - More CLI fixes
Closed 3 years ago by spichugi. Opened 4 years ago by mreynolds.
mreynolds/389-ds-base ui_fixes  into  master

file modified
+24 -17
@@ -1542,16 +1542,19 @@ 

          :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 @@ 

          """

          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'))

  

Description: Harden the get RUV/agmtMaxCSN in case DB is missing the ruv/tombstone entry

relates: https://pagure.io/389-ds-base/issue/50780

Seems reasonable to me :) ack

rebased onto 3022f46

4 years ago

Pull-Request has been merged by mreynolds

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3850

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago
Metadata