From eeec0d925e3cc9bb33ed544815904f31c6c9b9ed Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Sat, 17 Mar 2012 00:19:40 -0700 Subject: upgrade provision didn't run findprovisionrange anymore Autobuild-User: Matthieu Patou Autobuild-Date: Sat Mar 17 09:51:46 CET 2012 on sn-devel-104 --- source4/scripting/bin/upgradeprovision | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'source4') diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision index 41edd07f12..e578c14b80 100755 --- a/source4/scripting/bin/upgradeprovision +++ b/source4/scripting/bin/upgradeprovision @@ -53,7 +53,7 @@ from samba.schema import get_linked_attributes, Schema, get_schema_descriptor from samba.dcerpc import security, drsblobs from samba.ndr import ndr_unpack from samba.upgradehelpers import (dn_sort, get_paths, newprovision, - get_ldbs, + get_ldbs, findprovisionrange, usn_in_range, identic_rename, get_diff_sddls, update_secrets, CHANGE, ERROR, SIMPLE, CHANGEALL, GUESS, CHANGESD, PROVISION, @@ -62,7 +62,8 @@ from samba.upgradehelpers import (dn_sort, get_paths, newprovision, update_machine_account_password, search_constructed_attrs_stored, int64range2str, update_dns_account_password, - increment_calculated_keyversion_number) + increment_calculated_keyversion_number, + print_provision_ranges) from samba.xattr import copytree_with_xattrs replace=2**FLAG_MOD_REPLACE @@ -1698,12 +1699,16 @@ if __name__ == '__main__': message(SIMPLE, "Your provision lacks provision range information") if confirm("Do you want to run findprovisionusnranges to try to find them ?", False): ldbs.groupedRollback() - os.system("%s %s %s %s %s" % (os.path.join(os.path.dirname(sys.argv[0]), - "findprovisionusnranges"), - "--storedir", - paths.private_dir, - "-s", - smbconf)) + minobj = 5 + (hash_id, nb_obj) = findprovisionrange(ldbs.sam, ldb.Dn(ldbs.sam, str(names.rootdn))) + message(SIMPLE, "Here is a list of changes that modified more than %d objects in 1 minute." % minobj) + message(SIMPLE, "Usually changes made by provision and upgradeprovision are those who affect a couple"\ + " of hundred of objects or more") + message(SIMPLE, "Total number of objects: %d" % nb_obj) + message(SIMPLE, "") + + print_provision_ranges(hash_id, minobj, None, str(paths.samdb), str(names.invocation)) + message(SIMPLE, "Once you applied/adapted the change(s) please restart the upgradeprovision script") sys.exit(0) -- cgit