samba_upgradeprovision: do not maintain dnNotToRecalculate as a list
authorAndrew Bartlett <abartlet@samba.org>
Mon, 18 Feb 2013 04:15:52 +0000 (15:15 +1100)
committerStefan Metzmacher <metze@samba.org>
Mon, 4 Mar 2013 07:33:51 +0000 (08:33 +0100)
We only need a boolean indication, not the actual values.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/scripting/bin/samba_upgradeprovision

index c3c0c4e8f98801ebe878604abf54cb5812a52e88..cc8c633451875f54e6a281b687cf3c834e5961a0 100755 (executable)
@@ -149,7 +149,7 @@ hashOverwrittenAtt = {  "prefixMap": replace, "systemMayContain": replace,
                         "attributeDisplayNames": replace + add,
                         "versionNumber": add}
 
-dnNotToRecalculate = []
+dnNotToRecalculateFound = False
 dnToRecalculate = []
 backlinked = []
 forwardlinked = set()
@@ -919,7 +919,7 @@ def checkKeepAttributeWithMetadata(delta, att, message, reference, current,
                     message(CHANGESD, "But the SD has been changed by someonelse "
                                     "so it's impossible to know if the difference"
                                     " cames from the modification or from a previous bug")
-                    dnNotToRecalculate.append(str(dn))
+                    dnNotToRecalculateFound = True
                 else:
                     dnToRecalculate.append(str(dn))
                 continue
@@ -1333,8 +1333,6 @@ def rebuild_sd(samdb, names):
         # well known SDs have already been reset
         if key in listWellknown:
             continue
-        if key in dnNotToRecalculate:
-            continue
         delta = Message()
         delta.dn = Dn(samdb, key)
         sd_flags = SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL | SECINFO_SACL
@@ -1872,7 +1870,7 @@ if __name__ == '__main__':
         # as we are assured that on this DNs we will have differences !
         # Also the check must be done in a clever way as for the moment we just
         # compare SDDL
-        if len(dnNotToRecalculate) == 0 and (opts.debugchangesd or opts.debugall):
+        if dnNotToRecalculateFound == False and (opts.debugchangesd or opts.debugall):
             message(CHANGESD, "Checking recalculated SDs")
             check_updated_sd(new_ldbs.sam, ldbs.sam, names)