From 97c1c95f20762055932a83cb7ac08a408437a661 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Thu, 31 Oct 2013 16:55:07 +0000 Subject: Convert remaining update code to LDAPEntry API. --- ipaserver/install/plugins/update_idranges.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'ipaserver/install/plugins/update_idranges.py') 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: -- cgit