#51145 Issue 51144 - dsctl fails with instance names that contain slapd-
Closed 3 years ago by spichugi. Opened 3 years ago by mreynolds.
mreynolds/389-ds-base issue51144  into  master

@@ -710,7 +710,7 @@ 

          # Don't need a default value now since it's set in init.

          if serverid is None and hasattr(self, 'serverid'):

              serverid = self.serverid

-         elif serverid is not None:

+         elif serverid is not None and serverid.startswith('slapd-'):

              serverid = serverid.replace('slapd-', '', 1)

  

          if self.serverid is None:

file modified
+2 -1
@@ -40,7 +40,8 @@ 

          if serverid:

              # Get the dse.ldif from the instance name

              prefix = os.environ.get('PREFIX', ""),

-             serverid = serverid.replace("slapd-", "")

+             if serverid.startswith("slapd-"):

+                 serverid = serverid.replace("slapd-", "", 1)

              self.path = "{}/etc/dirsrv/slapd-{}/dse.ldif".format(prefix[0], serverid)

          else:

              ds_paths = Paths(self._instance.serverid, self._instance)

Bug Description:

If an instance name contains 'slapd-' the CLI breaks: slapd-test-slapd

Fix Description:

Only strip off "slapd-" from the front of the instance name.

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

rebased onto 3a964c2

3 years ago

Pull-Request has been merged by mreynolds

3 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/4198

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