From 8bbd52e347f3e6395d469528e1220fd9158e5609 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 27 May 2014 12:21:33 +0200 Subject: pwpolicy-mod: Fix crash when priority is changed The exc_callback was expecting the old update_entry signature, (dn, attrs). This was changed to just (entry) for ticket #2660, see http://www.freeipa.org/page/HowTo/Migrate_your_code_to_the_new_LDAP_API. Update the exc_callback to expect the entry as first argument, and add some tests. https://fedorahosted.org/freeipa/ticket/4309 Reviewed-By: Martin Kosek --- ipalib/plugins/pwpolicy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ipalib/plugins/pwpolicy.py') diff --git a/ipalib/plugins/pwpolicy.py b/ipalib/plugins/pwpolicy.py index 9c8b711b8..ee7f388ba 100644 --- a/ipalib/plugins/pwpolicy.py +++ b/ipalib/plugins/pwpolicy.py @@ -456,7 +456,7 @@ class pwpolicy_mod(LDAPUpdate): def exc_callback(self, keys, options, exc, call_func, *call_args, **call_kwargs): if call_func.func_name == 'update_entry': if isinstance(exc, errors.EmptyModlist): - entry_attrs = call_args[1] + entry_attrs = call_args[0] cosupdate = getattr(context, 'cosupdate') if not entry_attrs or cosupdate: return -- cgit