From: Matthieu Patou Date: Sat, 23 Oct 2010 18:01:30 +0000 (+0400) Subject: upgradeprovision: use the relax/(upgrade)provision when modifying object X-Git-Url: http://git.samba.org/?p=abartlet%2Fsamba.git%2F.git;a=commitdiff_plain;h=8227d1f68ef7a4750d23d0c34402dbc0c1d14a3e 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. --- 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):