summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/plugins/rename_managed.py
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2013-10-31 16:55:07 +0000
committerPetr Viktorin <pviktori@redhat.com>2014-01-24 20:29:31 +0100
commit97c1c95f20762055932a83cb7ac08a408437a661 (patch)
tree45fe75881605384be220c4fab7d226f42d3077ce /ipaserver/install/plugins/rename_managed.py
parent08051f16516a3978494ae94032d55cc8b1426df9 (diff)
downloadfreeipa-97c1c95f20762055932a83cb7ac08a408437a661.tar.gz
freeipa-97c1c95f20762055932a83cb7ac08a408437a661.tar.xz
freeipa-97c1c95f20762055932a83cb7ac08a408437a661.zip
Convert remaining update code to LDAPEntry API.
Diffstat (limited to 'ipaserver/install/plugins/rename_managed.py')
-rw-r--r--ipaserver/install/plugins/rename_managed.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/ipaserver/install/plugins/rename_managed.py b/ipaserver/install/plugins/rename_managed.py
index dad9259da..13e6dae5d 100644
--- a/ipaserver/install/plugins/rename_managed.py
+++ b/ipaserver/install/plugins/rename_managed.py
@@ -77,15 +77,15 @@ class GenerateUpdateMixin(object):
old_dn = entry['managedtemplate'][0]
assert isinstance(old_dn, DN)
try:
- (old_dn, entry) = ldap.get_entry(old_dn, ['*'])
+ entry = ldap.get_entry(old_dn, ['*'])
except errors.NotFound, e:
pass
else:
# Compute the new dn by replacing the old container with the new container
- new_dn = EditableDN(old_dn)
+ new_dn = EditableDN(entry.dn)
if new_dn.replace(old_template_container, new_template_container) != 1:
self.error("unable to replace '%s' with '%s' in '%s'",
- old_template_container, new_template_container, old_dn)
+ old_template_container, new_template_container, entry.dn)
continue
new_dn = DN(new_dn)
@@ -95,10 +95,10 @@ class GenerateUpdateMixin(object):
'default': entry_to_update(entry)}
# Delete the old entry
- old_update = {'dn': old_dn, 'deleteentry': None}
+ old_update = {'dn': entry.dn, 'deleteentry': None}
# Add the delete and replacement updates to the list of all updates
- update_list.append({old_dn: old_update, new_dn: new_update})
+ update_list.append({entry.dn: old_update, new_dn: new_update})
else:
# Update the template dn by replacing the old containter with the new container