From 8227d1f68ef7a4750d23d0c34402dbc0c1d14a3e Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Sat, 23 Oct 2010 22:01:30 +0400 Subject: upgradeprovision: use the relax/(upgrade)provision when modifying object For certain attribute we use the relax/provision control so that we try to respect checks as this is not a good idea to always force unwanted behavior. --- source4/scripting/bin/upgradeprovision | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source4/scripting/bin') diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision index 4dd8f533be7..e1ef57193d6 100755 --- a/source4/scripting/bin/upgradeprovision +++ b/source4/scripting/bin/upgradeprovision @@ -984,10 +984,17 @@ def update_present(ref_samdb, samdb, basedn, listPresent, usns, invocationid): delta.dn = dn if len(delta.items()) >1: attributes=", ".join(delta.keys()) + modcontrols = [] + relaxedatt = ['iscriticalsystemobject', 'grouptype'] + # Let's try to reduce as much as possible the use of relax control + #for checkedatt in relaxedatt: + for attr in delta.keys(): + if attr.lower() in relaxedatt: + modcontrols = ["relax:0", "local_oid:1.3.6.1.4.1.7165.4.3.16:0"] message(CHANGE, "%s is different from the reference one, changed" " attributes: %s\n" % (dn, attributes)) changed += 1 - samdb.modify(delta) + samdb.modify(delta, modcontrols) return changed def reload_full_schema(samdb, names): -- cgit