summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/migration.py
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-04-17 20:39:32 +0200
committerRob Crittenden <rcritten@redhat.com>2012-04-17 00:20:31 -0400
commit88927fb78b5dd8df6fdccb79c84c02691c7aeb46 (patch)
tree487b4948534a64ff25679e33451aafbcaaa37db7 /ipalib/plugins/migration.py
parenta663e83cb2717ac4cf831261c93c1582f562a07f (diff)
downloadfreeipa-88927fb78b5dd8df6fdccb79c84c02691c7aeb46.tar.gz
freeipa-88927fb78b5dd8df6fdccb79c84c02691c7aeb46.tar.xz
freeipa-88927fb78b5dd8df6fdccb79c84c02691c7aeb46.zip
Do not fail migration because of duplicate groups
When 2 groups in a remote LDAP server share the same GID number, the migration may fail entirely with incomprehensible message. This should not be taken as unrecoverable error - GID number check is just a sanity check, a warning is enough. This patch also makes sure that GID check warnings include a user name to make an investigation easier. https://fedorahosted.org/freeipa/ticket/2644
Diffstat (limited to 'ipalib/plugins/migration.py')
-rw-r--r--ipalib/plugins/migration.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ipalib/plugins/migration.py b/ipalib/plugins/migration.py
index 74cdd6ce2..a7b078975 100644
--- a/ipalib/plugins/migration.py
+++ b/ipalib/plugins/migration.py
@@ -146,7 +146,12 @@ def _pre_migrate_user(ldap, pkey, dn, entry_attrs, failed, config, ctx, **kwargs
)
valid_gids.append(entry_attrs['gidnumber'][0])
except errors.NotFound:
- api.log.warn('Migrated user\'s GID number %s does not point to a known group.' % entry_attrs['gidnumber'][0])
+ api.log.warn('GID number %s of migrated user %s does not point to a known group.' \
+ % (entry_attrs['gidnumber'][0], pkey))
+ except errors.SingleMatchExpected, e:
+ # GID number matched more groups, this should not happen
+ api.log.warn('GID number %s of migrated user %s should match 1 group, but it matched %d groups' \
+ % (entry_attrs['gidnumber'][0], pkey, e.found))
# We don't want to create a UPG so set the magic value in description
# to let the DS plugin know.