]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4/scripting: PY3 need to convert cmp funct to key func for sort.
authorNoel Power <noel.power@suse.com>
Mon, 15 Oct 2018 09:36:19 +0000 (10:36 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 23 Oct 2018 03:50:24 +0000 (05:50 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/scripting/bin/samba_upgradeprovision

index 20cd09fc240f9690c69199264cfef47206486ec6..c638e6333682fbc2cb69ff8c6e2a5bb50930dedc 100755 (executable)
@@ -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