From 0cb9882be9dc13781fb566df11df8bb962ea1ca9 Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Fri, 9 Mar 2012 12:36:03 +0100 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 --- ipalib/plugins/migration.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ipalib/plugins/migration.py') diff --git a/ipalib/plugins/migration.py b/ipalib/plugins/migration.py index a3baf97f..7adddb5a 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 -- cgit