From dcf787b26354d133a26dcad74cc62fe62b59a87d Mon Sep 17 00:00:00 2001 From: Noel Power Date: Mon, 15 Oct 2018 10:36:19 +0100 Subject: [PATCH] s4/scripting: PY3 need to convert cmp funct to key func for sort. Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett --- source4/scripting/bin/samba_upgradeprovision | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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