sysaccount_mod: Use object.__setattr__ to set allow_empty_update in exception handler

The error only happens in developer mode (when mode=developer instead of
mode=production in /etc/ipa/default.conf). Using object.__setattr__ bypasses
normal attribute assignment which fails in developer mode when trying to set
the class attribute allow_empty_update on an instance.

Signed-off-by: Anuja More <amore@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: PRANAV THUBE <pthube@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: PRANAV THUBE <pthube@redhat.com>
This commit is contained in:
Anuja More authored and Rafael Guterres Jeffman committed 2025-12-16 11:16:34 -03:00
1 parent 8eeccb6dba
commit f580f12e5b
1 file changed
+2 -2
+2 -2
View File
@@ -349,13 +349,13 @@ class sysaccount_mod(LDAPUpdate):
except (errors.EmptyModlist,
errors.NotGroupMember,
errors.AlreadyGroupMember):
self.allow_empty_update = False
object.__setattr__(self, 'allow_empty_update', False)
setattr(context, 'privileged', entry_attrs['privileged'])
del entry_attrs['privileged']
if 'privileged' not in options:
self.allow_empty_update = False
object.__setattr__(self, 'allow_empty_update', False)
validate_nsaccountlock(entry_attrs)