summaryrefslogtreecommitdiff
path: root/source4/scripting/bin/upgradeprovision
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-01-12 20:13:33 +0300
committerAndrew Bartlett <abartlet@samba.org>2010-01-21 07:11:19 +1300
commitbd9fbdab4c6ebe703800baccc274206fc1bd4ada (patch)
tree4ff9839fbca39b2ad3de7931a577dc178ac09de0 /source4/scripting/bin/upgradeprovision
parent9704249ccc6d3d5f0a0c1860ab869d0304118849 (diff)
downloadsamba-bd9fbdab4c6ebe703800baccc274206fc1bd4ada.tar.gz
samba-bd9fbdab4c6ebe703800baccc274206fc1bd4ada.tar.bz2
samba-bd9fbdab4c6ebe703800baccc274206fc1bd4ada.zip
Revert "s4:upgradeprovision - fix up the script regarding linked attributes"
This reverts commit 2cedefabc93c8a1fcb49d65a3f78a344e814f826.
Diffstat (limited to 'source4/scripting/bin/upgradeprovision')
-rwxr-xr-xsource4/scripting/bin/upgradeprovision58
1 files changed, 12 insertions, 46 deletions
diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
index ac6fbdec7d..f63605b2af 100755
--- a/source4/scripting/bin/upgradeprovision
+++ b/source4/scripting/bin/upgradeprovision
@@ -560,52 +560,18 @@ def check_diff_name(newpaths,paths,creds,session,basedn,names,ischema):
sam_ldb.transaction_start()
- err_num = 0
- err_msg = ""
- while len(listMissing) > 0:
- listMissing2 = []
-
- empty = ldb.Message()
- message(SIMPLE,"There are still %d objects missing"%(len(listMissing)))
-
- for dn in listMissing:
- reference = newsam_ldb.search(expression="dn=%s" % (str(dn)),
- base=basedn, scope=SCOPE_SUBTREE,
- controls=["search_options:1:2"])
- delta = sam_ldb.msg_diff(empty,reference[0])
- for att in hashAttrNotCopied.keys():
- delta.remove(att)
- for att in backlinked:
- delta.remove(att)
- delta.dn = dn
-
- try:
- sam_ldb.add(delta,["relax:0"])
- # This is needed here since otherwise the
- # "replmd_meta_data" module doesn't see the
- # updated data
- sam_ldb.transaction_commit()
- sam_ldb.transaction_start()
- except LdbError, (num, msg):
- # An exception can happen if a linked object
- # doesn't exist which can happen if it is also
- # to be added
- err_num = num
- err_msg = msg
- listMissing2.append(dn)
-
- if len(listMissing2) == len(listMissing):
- # We couldn't add any object in this iteration ->
- # we have to resign and hope that the user manually
- # fixes the damage
-
- message(ERROR, "The script isn't capable to do the upgrade fully automatically!")
- message(ERROR, "Often this happens when important system objects moved their location. Please look for them (for example doable using the displayed 'sAMAccountName' attribute), backup if personally changed and remove them.")
- message(ERROR, "Reinvoke this script and reapply eventual modifications done before. It is possible to get this error more than once (for each problematic object).")
-
- raise LdbError(err_num, err_msg)
-
- listMissing = listMissing2
+ empty = ldb.Message()
+ message(SIMPLE,"There are %d missing objects"%(len(listMissing)))
+ for dn in listMissing:
+ reference = newsam_ldb.search(expression="dn=%s"%(str(dn)),base=basedn, scope=SCOPE_SUBTREE,controls=["search_options:1:2"])
+ delta = sam_ldb.msg_diff(empty,reference[0])
+ for att in hashAttrNotCopied.keys():
+ delta.remove(att)
+ for att in backlinked:
+ delta.remove(att)
+ delta.dn = dn
+
+ sam_ldb.add(delta,["relax:0"])
changed = 0
for dn in listPresent: