summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-05-21 08:33:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:52:42 -0500
commitd21bfc05ef1643039c7a5f602dd15f22408af4af (patch)
tree214153d73659aa5715716a910efd45e5763d2be7 /source4/scripting
parentfcd4f22cd6c0050b775625ec561987a968bcccf7 (diff)
downloadsamba-d21bfc05ef1643039c7a5f602dd15f22408af4af.tar.gz
samba-d21bfc05ef1643039c7a5f602dd15f22408af4af.tar.bz2
samba-d21bfc05ef1643039c7a5f602dd15f22408af4af.zip
r23032: Remove calls to println(), and ensure we print the ldb errstring().
Andrew Bartlett (This used to be commit 5b6f704b24f7da40ce917fe8ed1a500684d1f3cd)
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/libjs/provision.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js
index 3bbba6a9a6..d9bdb3b16b 100644
--- a/source4/scripting/libjs/provision.js
+++ b/source4/scripting/libjs/provision.js
@@ -140,9 +140,9 @@ function hostname()
/* the ldb is in bad shape, possibly due to being built from an
incompatible previous version of the code, so delete it
completely */
-function ldb_delete(ldb)
+function ldb_delete(info, ldb)
{
- println("Deleting " + ldb.filename);
+ info.message("Deleting " + ldb.filename + "\n");
var lp = loadparm_init();
sys.unlink(sprintf("%s/%s", lp.get("private dir"), ldb.filename));
ldb.transaction_cancel();
@@ -155,7 +155,7 @@ function ldb_delete(ldb)
/*
erase an ldb, removing all records
*/
-function ldb_erase(ldb)
+function ldb_erase(info, ldb)
{
var res;
@@ -173,7 +173,7 @@ function ldb_erase(ldb)
var res = ldb.search("(&(|(objectclass=*)(dn=*))(!(dn=@BASEINFO)))", basedn, ldb.SCOPE_SUBTREE, attrs);
var i;
if (res.error != 0) {
- ldb_delete(ldb);
+ ldb_delete(info, ldb);
return;
}
for (i=0;i<res.msgs.length;i++) {
@@ -182,7 +182,7 @@ function ldb_erase(ldb)
var res = ldb.search("(&(|(objectclass=*)(dn=*))(!(dn=@BASEINFO)))", basedn, ldb.SCOPE_SUBTREE, attrs);
if (res.error != 0 || res.msgs.length != 0) {
- ldb_delete(ldb);
+ ldb_delete(info, ldb);
return;
}
assert(res.msgs.length == 0);
@@ -260,7 +260,7 @@ function open_ldb(info, dbname, erase)
ldb.transaction_start();
if (erase) {
- ldb_erase(ldb);
+ ldb_erase(info, ldb);
}
return ldb;
}
@@ -571,7 +571,7 @@ function provision(subobj, message, blank, paths, session_info, credentials, lda
var modify_ok = setup_ldb_modify("provision_basedn_modify.ldif", info, samdb);
if (!modify_ok) {
if (!add_ok) {
- message("Failed to both add and modify " + subobj.DOMAINDN + " in target " + subobj.DOMAINDN_LDB + "\n");
+ message("Failed to both add and modify " + subobj.DOMAINDN + " in target " + subobj.DOMAINDN_LDB + ": " + samdb.errstring() + "\n");
message("Perhaps you need to run the provision script with the --ldap-base-dn option, and add this record to the backend manually\n");
};
assert(modify_ok);
@@ -583,7 +583,8 @@ function provision(subobj, message, blank, paths, session_info, credentials, lda
var modify_ok = setup_ldb_modify("provision_configuration_basedn_modify.ldif", info, samdb);
if (!modify_ok) {
if (!add_ok) {
- message("Failed to both add and modify the configuration container\n");
+ message("Failed to both add and modify configuration dn: " + samdb.errstring() + "\n");
+ message("Perhaps you need to run the provision script with the --ldap-base-dn option, and add this record to the backend manually\n");
assert(modify_ok);
}
assert(modify_ok);
@@ -595,7 +596,8 @@ function provision(subobj, message, blank, paths, session_info, credentials, lda
var modify_ok = setup_ldb_modify("provision_schema_basedn_modify.ldif", info, samdb);
if (!modify_ok) {
if (!add_ok) {
- message("Failed to both add and modify the schema container: " + samdb.errstring() + "\n");
+ message("Failed to both add and modify schema dn: + samdb.errstring() + "\n");
+ message("Perhaps you need to run the provision script with the --ldap-base-dn option, and add this record to the backend manually\n");
assert(modify_ok);
}
message("Failed to modify the schema container: " + samdb.errstring() + "\n");