r26303: Fix up error reporting during the delete of previous entries in the
authorAndrew Bartlett <abartlet@samba.org>
Wed, 5 Dec 2007 02:00:48 +0000 (03:00 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:48:18 +0000 (05:48 +0100)
provision, and ignore 'no such entry' as an error (it is normal, and
just means the partition is compleatly empty).

Andrew Bartlett
(This used to be commit 1fb8c31a3da6fc07f55027f05dba5e03dcf8a4f7)

source4/scripting/libjs/provision.js

index e7e844bb89a388c3a302ad924f671c5d47f490f3..5e9e43a858afb9b0e7a04c540a9ba8071ded7d70 100644 (file)
@@ -224,7 +224,10 @@ function ldb_erase_partitions(info, ldb, ldapbackend)
                        var res2 = ldb.search(anything, basedn, ldb.SCOPE_SUBTREE, attrs);
                        var i;
                        if (res2.error != 0) {
-                               info.message("ldb search failed: " + res.errstr + "\n");
+                               if (res2.error == 32) {
+                                       break;
+                               }
+                               info.message("ldb search failed: " + res2.errstr + "\n");
                                continue;
                        }
                        previous_remaining = current_remaining;
@@ -235,7 +238,7 @@ function ldb_erase_partitions(info, ldb, ldapbackend)
                        
                        var res3 = ldb.search(anything, basedn, ldb.SCOPE_SUBTREE, attrs);
                        if (res3.error != 0) {
-                               info.message("ldb search failed: " + res.errstr + "\n");
+                               info.message("ldb search failed: " + res3.errstr + "\n");
                                continue;
                        }
                        if (res3.msgs.length != 0) {