summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/plugins/update_idranges.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/update_idranges.py
parent08051f16516a3978494ae94032d55cc8b1426df9 (diff)
downloadfreeipa.git-97c1c95f20762055932a83cb7ac08a408437a661.tar.gz
freeipa.git-97c1c95f20762055932a83cb7ac08a408437a661.tar.xz
freeipa.git-97c1c95f20762055932a83cb7ac08a408437a661.zip
Convert remaining update code to LDAPEntry API.
Diffstat (limited to 'ipaserver/install/plugins/update_idranges.py')
-rw-r--r--ipaserver/install/plugins/update_idranges.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/ipaserver/install/plugins/update_idranges.py b/ipaserver/install/plugins/update_idranges.py
index c3df98af..9e97c9f7 100644
--- a/ipaserver/install/plugins/update_idranges.py
+++ b/ipaserver/install/plugins/update_idranges.py
@@ -71,27 +71,25 @@ class update_idrange_type(PostUpdate):
error = False
# Set the range type
- for dn, entry in entries:
- update = {}
-
+ for entry in entries:
objectclasses = [o.lower() for o
in entry.get('objectclass', [])]
if 'ipatrustedaddomainrange' in objectclasses:
# NOTICE: assumes every AD range does not use POSIX
# attributes
- update['ipaRangeType'] = 'ipa-ad-trust'
+ entry['ipaRangeType'] = ['ipa-ad-trust']
elif 'ipadomainidrange' in objectclasses:
- update['ipaRangeType'] = 'ipa-local'
+ entry['ipaRangeType'] = ['ipa-local']
else:
- update['ipaRangeType'] = 'unknown'
+ entry['ipaRangeType'] = ['unknown']
root_logger.error("update_idrange_type: could not detect "
- "range type for entry: %s" % str(dn))
+ "range type for entry: %s" % str(entry.dn))
root_logger.error("update_idrange_type: ID range type set "
- "to 'unknown' for entry: %s" % str(dn))
+ "to 'unknown' for entry: %s" % str(entry.dn))
try:
- ldap.update_entry(dn, update)
+ ldap.update_entry(entry)
except (errors.EmptyModlist, errors.NotFound):
pass
except errors.ExecutionError, e: