summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2012-03-17 00:19:40 -0700
committerMatthieu Patou <mat@samba.org>2012-03-17 09:51:46 +0100
commiteeec0d925e3cc9bb33ed544815904f31c6c9b9ed (patch)
tree7f198bf7b8dcc8c9b10818dd914dd0860582cf00
parent552d223939495fe3809717ad29123ac3b7cd6e64 (diff)
downloadsamba-eeec0d925e3cc9bb33ed544815904f31c6c9b9ed.tar.gz
samba-eeec0d925e3cc9bb33ed544815904f31c6c9b9ed.tar.bz2
samba-eeec0d925e3cc9bb33ed544815904f31c6c9b9ed.zip
upgrade provision didn't run findprovisionrange anymore
Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Sat Mar 17 09:51:46 CET 2012 on sn-devel-104
-rwxr-xr-xsource4/scripting/bin/upgradeprovision21
1 files changed, 13 insertions, 8 deletions
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)