From: Noel Power Date: Mon, 15 Oct 2018 09:36:19 +0000 (+0100) Subject: s4/scripting: PY3 need to convert cmp funct to key func for sort. X-Git-Tag: tdb-1.3.17~1259 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dcf787b26354d133a26dcad74cc62fe62b59a87d;p=thirdparty%2Fsamba.git s4/scripting: PY3 need to convert cmp funct to key func for sort. Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett --- diff --git a/source4/scripting/bin/samba_upgradeprovision b/source4/scripting/bin/samba_upgradeprovision index 20cd09fc240..c638e633368 100755 --- a/source4/scripting/bin/samba_upgradeprovision +++ b/source4/scripting/bin/samba_upgradeprovision @@ -70,6 +70,7 @@ from samba.upgradehelpers import (dn_sort, get_paths, newprovision, increment_calculated_keyversion_number, print_provision_ranges) from samba.xattr import copytree_with_xattrs +from samba.compat import cmp_to_key_fn # make sure the script dies immediately when hitting control-C, # rather than raising KeyboardInterrupt. As we do all database @@ -1133,8 +1134,8 @@ def update_partition(ref_samdb, samdb, basedn, names, schema, provisionUSNs, pre # Sort the missing object in order to have object of the lowest level # first (which can be containers for higher level objects) - listMissing.sort(dn_sort) - listPresent.sort(dn_sort) + listMissing.sort(key=cmp_to_key_fn(dn_sort)) + listPresent.sort(key=cmp_to_key_fn(dn_sort)) # The following lines is to load the up to # date schema into our current LDB