mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Move common code of user and stageuser to baseuser postcallback
usser-add and stageuser-add contains common code that can be exported to baseuser common postcallback Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
@@ -491,6 +491,9 @@ class baseuser_add(LDAPCreate):
|
||||
def post_common_callback(self, ldap, dn, entry_attrs, **options):
|
||||
assert isinstance(dn, DN)
|
||||
self.obj.convert_usercertificate_post(entry_attrs, **options)
|
||||
self.obj.get_password_attributes(ldap, dn, entry_attrs)
|
||||
convert_sshpubkey_post(ldap, dn, entry_attrs)
|
||||
radius_dn2pk(self.api, entry_attrs)
|
||||
|
||||
class baseuser_del(LDAPDelete):
|
||||
"""
|
||||
|
||||
@@ -389,9 +389,7 @@ class stageuser_add(baseuser_add):
|
||||
# if both randompassword and userpassword options were used
|
||||
pass
|
||||
|
||||
self.obj.get_password_attributes(ldap, dn, entry_attrs)
|
||||
convert_sshpubkey_post(ldap, dn, entry_attrs)
|
||||
radius_dn2pk(self.api, entry_attrs)
|
||||
self.post_common_callback(ldap, dn, entry_attrs, **options)
|
||||
return dn
|
||||
|
||||
@register()
|
||||
|
||||
@@ -568,9 +568,6 @@ class user_add(baseuser_add):
|
||||
# if both randompassword and userpassword options were used
|
||||
pass
|
||||
|
||||
self.obj.get_password_attributes(ldap, dn, entry_attrs)
|
||||
convert_sshpubkey_post(ldap, dn, entry_attrs)
|
||||
radius_dn2pk(self.api, entry_attrs)
|
||||
self.obj.get_preserved_attribute(entry_attrs, options)
|
||||
|
||||
self.post_common_callback(ldap, dn, entry_attrs, **options)
|
||||
|
||||
Reference in New Issue
Block a user