summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2015-07-23 10:52:54 +0200
committerMartin Basti <mbasti@redhat.com>2015-07-29 17:06:54 +0200
commitcea52ce186d9341f126ef6a9ac5f0287c4f16ada (patch)
treef346d48736466e8bf62cad6bfcd7edb9d5ed1378
parent45c709112da1514d57db46f9706bc03920574adf (diff)
downloadfreeipa-cea52ce186d9341f126ef6a9ac5f0287c4f16ada.zip
freeipa-cea52ce186d9341f126ef6a9ac5f0287c4f16ada.tar.gz
freeipa-cea52ce186d9341f126ef6a9ac5f0287c4f16ada.tar.xz
ULC: Fix stageused-add --from-delete command
Nonexistent method was used to move deleted user to staged area. Minor fixes added: * handle not found error * return new DN https://fedorahosted.org/freeipa/ticket/5145 Reviewed-By: David Kupka <dkupka@redhat.com>
-rw-r--r--ipalib/plugins/stageuser.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/ipalib/plugins/stageuser.py b/ipalib/plugins/stageuser.py
index c0c4c87..29739d5 100644
--- a/ipalib/plugins/stageuser.py
+++ b/ipalib/plugins/stageuser.py
@@ -377,16 +377,17 @@ class stageuser_add(baseuser_add):
staging_dn = self.obj.get_dn(*keys, **options)
delete_dn = DN(staging_dn[0], self.obj.delete_container_dn, api.env.basedn)
-
+ new_dn = DN(staging_dn[0], self.obj.stage_container_dn, api.env.basedn)
# Check that this value is a Active user
try:
entry_attrs = self._exc_wrapper(keys, options, ldap.get_entry)(delete_dn, ['dn'])
except errors.NotFound:
- raise
- self._exc_wrapper(keys, options, ldap.move_entry_newsuperior)(delete_dn, str(DN(self.obj.stage_container_dn, api.env.basedn)))
+ self.obj.handle_not_found(*keys)
+ self._exc_wrapper(keys, options, ldap.move_entry)(
+ delete_dn, new_dn)
entry_attrs = entry_to_dict(entry_attrs, **options)
- entry_attrs['dn'] = delete_dn
+ entry_attrs['dn'] = new_dn
if self.obj.primary_key and keys[-1] is not None:
return dict(result=entry_attrs, value=keys[-1])