From 35dad9684b22819a2c848e7ebb78cfbc438a30e6 Mon Sep 17 00:00:00 2001 From: David Kupka Date: Nov 20 2014 15:49:13 +0000 Subject: Fix --{user,group}-ignore-attribute in migration plugin. Ignore case in attribute names. https://fedorahosted.org/freeipa/ticket/4620 Reviewed-By: Martin Basti --- diff --git a/ipalib/plugins/migration.py b/ipalib/plugins/migration.py index 6b630a4..fa3d512 100644 --- a/ipalib/plugins/migration.py +++ b/ipalib/plugins/migration.py @@ -196,9 +196,8 @@ def _pre_migrate_user(ldap, pkey, dn, entry_attrs, failed, config, ctx, **kwargs entry_attrs.setdefault('loginshell', default_shell) # do not migrate all attributes - for attr in entry_attrs.keys(): - if attr in attr_blacklist: - del entry_attrs[attr] + for attr in attr_blacklist: + entry_attrs.pop(attr, None) # do not migrate all object classes if 'objectclass' in entry_attrs: @@ -393,9 +392,8 @@ def _pre_migrate_group(ldap, pkey, dn, entry_attrs, failed, config, ctx, **kwarg raise ValueError('Schema %s not supported' % schema) # do not migrate all attributes - for attr in entry_attrs.keys(): - if attr in attr_blacklist: - del entry_attrs[attr] + for attr in attr_blacklist: + entry_attrs.pop(attr, None) # do not migrate all object classes if 'objectclass' in entry_attrs: