#50121 Ticket 49984 - python installer add option to create suffix entry
Closed by spichugi. Opened by mreynolds.
mreynolds/389-ds-base ticket49984  into  master

Download 50121.patch

Description:

Making the top suffix entry should be optional, and
not the fixed default behavior. Added a new option:

    create_suffix_entry   True/False

https://pagure.io/389-ds-base/issue/49984

Currently, it doesn't reach the point because backends is an empty list (because suffix is '' in _validate_ds_2_config).

I think we should set the default suffix to 'dc=example,dc=com' if it is not set in INF file (as it should be according to the docs in INF file)

Also, should we also add the option to UI?

Currently, it doesn't reach the point because backends is an empty list (because suffix is '' in _validate_ds_2_config).

Sorry I don't understand your concern. That code is definitely reached when I run dscreate.

I think we should set the default suffix to 'dc=example,dc=com' if it is not set in INF file (as it should be according to the docs in INF file)

But suffix is a required property IIRC, so there's no need for a default suffix, right?

So there is the INF which fails to create the root entry

[backend-userroot]
# create_suffix_entry (bool)
# Description: Set this parameter to "True" to create a generic root node entry for the suffix in the database.
# Default value: False
create_suffix_entry = True
# require_index (bool)
# Description: Set this parameter to "True" to refuse unindexed searches in this database.
# Default value: False
;require_index = False
# sample_entries (str)
# Description: Set this parameter to 'yes' to add latest version of sample entries to this database.  Or, use '001003006' to use the 1.3.6 version sample entries.  Use this option, for example, to create a database for testing purposes.
# Default value: no
;sample_entries = no
# suffix (str)
# Description: Sets the root suffix stored in this database.  If you do not uncomment the suffix attribute the install process will NOT create the backend/suffix.  You can also create multiple backends/suffixes by duplicating this section.
# Default value: dc=example,dc=com
;suffix = dc=example,dc=com

Then we parse the INF file suffix part here - https://pagure.io/389-ds-base/blob/master/f/src/lib389/lib389/instance/setup.py#_160

And it sets suffix to '' instead of dc=example,dc=com
So we never reach this point - https://pagure.io/389-ds-base/blob/master/f/src/lib389/lib389/instance/setup.py#_185

Which results in an empty backends list here - https://pagure.io/389-ds-base/blob/master/f/src/lib389/lib389/instance/setup.py#_841

Suffix is always required to create a backend though, because it's needed to establish the mapping tree options. I think that a missing suffix should fail in _validate_ds_2_config, which from your report, it sounds like it's correctly doing :)

Suffix is always required to create a backend though, because it's needed to establish the mapping tree options. I think that a missing suffix should fail in _validate_ds_2_config, which from your report, it sounds like it's correctly doing :)

My point is that we have this section:

# suffix (str)
# Description: Sets the root suffix stored in this database.  If you do not uncomment the suffix attribute the install process will NOT create the backend/suffix.  You can also create multiple backends/suffixes by duplicating this section.
# Default value: dc=example,dc=com
;suffix = dc=example,dc=com

Which states that the Default value is dc=example,dc=com. Shouldn't we set it in the code if [backend-NAME] is specified but suffix is not?

rebased onto 0168d077fac7fcb623b12bfd1cc6f8e4f6c07d1c

Hey guys, so... The way we setup backends via the INF file is unique compared to the other settings/sections.

If you do not specify a suffix then the backend is not created. This is by design because the backend section is already present, so the only way to to say create the backend is to set the suffix. It is not a problem to leave the suffix commented as nothing will happen.

What I did do was remove the default suffix value from the INF file and I improved the description, so hopefully it will be less confusing.

Looks good to me! Ack

I created https://pagure.io/freeipa/issue/7830 to track the issue. As temporary workaround I'm going to pin 389-ds version to 1.4.0.16

rebased onto a8fa9a992fb114f4f36562c6391113da1979eb31

Pull-Request has been merged by mreynolds

@mreynolds Do you have plans to release 1.4.0.21 with this fix on F28 and F29? IPA master is currently stuck on 1.4.0.16.

Never mind, Viktor just pointed me to https://koji.fedoraproject.org/koji/buildinfo?buildID=1184853

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/3180

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

Metadata