From 26b968c993ba65414d08e3d58991826cd229ed91 Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Mar 12 2012 03:50:19 +0000 Subject: Fix migration plugin compat check Ticket #2274 implements a check for compat plugin and warns user if it is enabled. However, there are 2 issues connected with the plugin: 1) The check is performed against the remote (migrated) LDAP server and not the local LDAP server, which does not make much sense 2) When the compat plugin is missing in cn=plugins,cn=config, it raises an error and thus breaks the migration This patch fixes both issues. https://fedorahosted.org/freeipa/ticket/2508 --- diff --git a/ipalib/plugins/migration.py b/ipalib/plugins/migration.py index a3baf97..7adddb5 100644 --- a/ipalib/plugins/migration.py +++ b/ipalib/plugins/migration.py @@ -670,9 +670,13 @@ can use their Kerberos accounts.''') #check whether the compat plugin is enabled if not options.get('compat'): - (dn,check_compat) = ds_ldap.get_entry(_compat_dn, normalize=False) - if check_compat is not None and check_compat.get('nsslapd-pluginenabled', [''])[0].lower() == 'on': - return dict(result={},failed={},enabled=True, compat=False) + try: + (dn,check_compat) = ldap.get_entry(_compat_dn, normalize=False) + if check_compat is not None and \ + check_compat.get('nsslapd-pluginenabled', [''])[0].lower() == 'on': + return dict(result={},failed={},enabled=True, compat=False) + except errors.NotFound: + pass if not ds_base_dn: # retrieve base DN from remote LDAP server