#5788 user-add postcallback is not efficient when --noprivate flag is set
Closed: fixed 3 years ago Opened 5 years ago by mbasti.

Following code removes NO_UPG_MAGIC from description when --noprivate option is used.

        # delete description attribute NO_UPG_MAGIC if present
        if options.get('noprivate', False):
            if not options.get('all', False):
                desc_attr = ldap.get_entry(dn, ['description'])
                entry_attrs.update(desc_attr)
            if 'description' in entry_attrs and NO_UPG_MAGIC in entry_attrs['description']:
                entry_attrs['description'].remove(NO_UPG_MAGIC)
                kw = {'setattr': unicode('description=%s' % ','.join(entry_attrs['description']))}
                try:
                    self.api.Command['user_mod'](keys[-1], **kw)
                except (errors.EmptyModlist, errors.NotFound):
                    pass

It uses user-mod to achieve this action, what is very heavy way. ldap.update_entry() call should be enough.

Also would be great to have creation users resolved in different way, that do not require additional 1-2 searches in post callback.


4.4.0 was released, moving open tickets to 4.4.1

Moving to next major version. Fixing this bug is not critical in stabilization release.

Metadata Update from @mbasti:
- Issue assigned to mbasti
- Issue set to the milestone: FreeIPA 4.5

4 years ago

Metadata Update from @mbasti:
- Issue close_status updated to: None
- Issue set to the milestone: FreeIPA 4.5.1 (was: FreeIPA 4.5)

4 years ago

Metadata Update from @tdudlak:
- Custom field component reset (from IPA)
- Custom field keywords reset (from performance)
- Custom field on_review reset (from 0)
- Custom field rhbz reset (from https://bugzilla.redhat.com/show_bug.cgi?id=1298288)
- Custom field test_coverage reset (from no)
- Custom field type reset (from defect)

4 years ago

Metadata Update from @stlaz:
- Custom field component adjusted to IPA
- Custom field keywords adjusted to performance
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1298288
- Custom field test_coverage adjusted to no
- Custom field type adjusted to defect

4 years ago

Metadata Update from @stlaz:
- Issue assigned to tdudlak (was: mbasti)

4 years ago

Metadata Update from @stlaz:
- Assignee reset

4 years ago

Metadata Update from @tdudlak:
- Custom field component reset (from IPA)
- Custom field keywords reset (from performance)
- Custom field rhbz reset (from https://bugzilla.redhat.com/show_bug.cgi?id=1298288)
- Custom field test_coverage reset (from no)
- Custom field type reset (from defect)
- Issue assigned to tdudlak

4 years ago

Metadata Update from @stlaz:
- Custom field component adjusted to IPA
- Custom field keywords adjusted to performance
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1298288
- Custom field test_coverage adjusted to no
- Custom field type adjusted to defect

4 years ago

Metadata Update from @mbasti:
- Issue set to the milestone: FreeIPA 4.5.2 (was: FreeIPA 4.5.1)

3 years ago

FreeIPA 4.5.1 has been released, moving to FreeIPA 4.5.2 milestone

master:

  • d73ec06 user.py: replace user_mod with ldap.update_entry()

ipa-4-5:

  • daeac31 user.py: replace user_mod with ldap.update_entry()

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

3 years ago

Login to comment on this ticket.

Metadata