e3ffab
From 7f2021b3fc501d3ee70976f4dba06629c71ae417 Mon Sep 17 00:00:00 2001
e3ffab
From: David Kupka <dkupka@redhat.com>
e3ffab
Date: Wed, 19 Nov 2014 09:57:59 -0500
e3ffab
Subject: [PATCH] Fix --{user,group}-ignore-attribute in migration plugin.
e3ffab
e3ffab
Ignore case in attribute names.
e3ffab
e3ffab
https://fedorahosted.org/freeipa/ticket/4620
e3ffab
e3ffab
Reviewed-By: Martin Basti <mbasti@redhat.com>
e3ffab
---
e3ffab
 ipalib/plugins/migration.py | 10 ++++------
e3ffab
 1 file changed, 4 insertions(+), 6 deletions(-)
e3ffab
e3ffab
diff --git a/ipalib/plugins/migration.py b/ipalib/plugins/migration.py
e3ffab
index 6b630a464f0be163e82de95afe3a74b22889574b..fa3d512bf1434c7d349713f78c292b481021303a 100644
e3ffab
--- a/ipalib/plugins/migration.py
e3ffab
+++ b/ipalib/plugins/migration.py
e3ffab
@@ -196,9 +196,8 @@ def _pre_migrate_user(ldap, pkey, dn, entry_attrs, failed, config, ctx, **kwargs
e3ffab
         entry_attrs.setdefault('loginshell', default_shell)
e3ffab
 
e3ffab
     # do not migrate all attributes
e3ffab
-    for attr in entry_attrs.keys():
e3ffab
-        if attr in attr_blacklist:
e3ffab
-            del entry_attrs[attr]
e3ffab
+    for attr in attr_blacklist:
e3ffab
+        entry_attrs.pop(attr, None)
e3ffab
 
e3ffab
     # do not migrate all object classes
e3ffab
     if 'objectclass' in entry_attrs:
e3ffab
@@ -393,9 +392,8 @@ def _pre_migrate_group(ldap, pkey, dn, entry_attrs, failed, config, ctx, **kwarg
e3ffab
         raise ValueError('Schema %s not supported' % schema)
e3ffab
 
e3ffab
     # do not migrate all attributes
e3ffab
-    for attr in entry_attrs.keys():
e3ffab
-        if attr in attr_blacklist:
e3ffab
-            del entry_attrs[attr]
e3ffab
+    for attr in attr_blacklist:
e3ffab
+        entry_attrs.pop(attr, None)
e3ffab
 
e3ffab
     # do not migrate all object classes
e3ffab
     if 'objectclass' in entry_attrs:
e3ffab
-- 
e3ffab
2.1.0
e3ffab