#50373 DNAPluginSharedConfig.create() is case sensitive
Closed: wontfix 3 years ago by spichugi. Opened 4 years ago by vashirov.

Issue Description

        log.info("Creating DNA shared config entry...")
        shared_configs = DNAPluginSharedConfigs(inst, ou_ranges.dn)
        shared_configs.create(properties={'dnaHostName': str(inst.host),
                                          'dnaPortNum': str(inst.port),
>                                         'dnaRemainingValues': '9501'})

dirsrvtests/tests/suites/plugins/dna_test.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/lib389/lib389/plugins.py:1922: in create
    return co.create(properties, self._basedn)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <lib389.plugins.DNAPluginSharedConfig object at 0x7f675d87d828>
properties = {'dnaHostName': 'server-rhel8.example.com', 'dnaPortNum': '38901', 'dnaRemainingValues': '9501'}, basedn = 'ou=ranges,dc=example,dc=com'
ensure = False

    def create(self, properties=None, basedn=None, ensure=False):
        """The shared config DNA plugin entry has two RDN values
            The function takes care about that special case
            """

        for attr in self._must_attributes:
            if properties.get(attr, None) is None:
>               raise ldap.UNWILLING_TO_PERFORM('Attribute %s must not be None' % attr)
E               ldap.UNWILLING_TO_PERFORM: Attribute dnaHostname must not be None

src/lib389/lib389/plugins.py:1847: UNWILLING_TO_PERFORM

Here we're passing dnaHostName in properties dict, but the method expects it to be dnaHostname (note the lower-case N).

The comparison should not be case sensitive.


I looked at other places in lib389 and the problem is a bit wider. We use dict but do not take into account attribute name normalization. Perhaps this should be solved by using case insensitive dictionaries.

An example implementation can be found in python requests library.

Metadata Update from @vashirov:
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None

4 years ago

Metadata Update from @mreynolds:
- Issue set to the milestone: 1.4.1

4 years ago

Metadata Update from @mreynolds:
- Issue priority set to: normal
- Issue set to the milestone: 1.4.3 (was: 1.4.1)

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 issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/3432

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.

Metadata