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:
Martin Basti committed 2015-11-20 15:32:34 +01:00
1 parent 2d041daf17
commit c56d45bc38
3 files changed
+4 -6

No files matched your search

+3
View File
@@ -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):
"""
+1 -3
View File
@@ -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()
-3
View File
@@ -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)