summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-08 14:02:22 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-08 14:02:22 +0100
commitf47093baf0a91c717297ebcbd1d3416d788ba6aa (patch)
treee1033c9b06c5067c8bbae54ab26c49050db0886e /source4/scripting/python
parentfffe4f3bdd27b11dce75c9b2c931f5291f04ab6b (diff)
parent0efa783849ff4bd449cdcc5f643f0101d48746bb (diff)
downloadsamba-f47093baf0a91c717297ebcbd1d3416d788ba6aa.tar.gz
samba-f47093baf0a91c717297ebcbd1d3416d788ba6aa.tar.bz2
samba-f47093baf0a91c717297ebcbd1d3416d788ba6aa.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-trivial
Conflicts: source/scripting/python/samba/provision.py (This used to be commit e367df5d994181f08ad1a20a0ce01991ca30bcc8)
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/STATUS1
-rw-r--r--source4/scripting/python/samba/provision.py44
2 files changed, 27 insertions, 18 deletions
diff --git a/source4/scripting/python/STATUS b/source4/scripting/python/STATUS
index 6e6475bfde..ee67b8bc7a 100644
--- a/source4/scripting/python/STATUS
+++ b/source4/scripting/python/STATUS
@@ -1,6 +1,5 @@
dsdb/samdb/ldb_modules/tests/samba3sam.py: Fix remaining failing tests
lib/ldb/tests/python/ldap.py: Fix remaining 3 FIXME's
-provisioning in LDAP mode(TEST_LDAP=yes PROVISION_PYTHON=yes make test)
command-line vampire
provisioning: combine some of the python dictionaries
finish scripting/bin/smbstatus.py
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index bcadcca583..0c16ab3bfe 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -323,10 +323,12 @@ def setup_samdb_partitions(samdb_path, setup_path, message, lp, session_info,
configdn_ldb = "configuration.ldb"
if ldap_backend is not None:
configdn_ldb = ldap_backend
- schema_ldb = "schema.ldb"
+ schemadn_ldb = "schema.ldb"
if ldap_backend is not None:
schema_ldb = ldap_backend
+ schemadn_ldb = ldap_backend
+
if ldap_backend_type == "fedora-ds":
backend_modules = ["nsuniqueid","paged_searches"]
elif ldap_backend_type == "openldap":
@@ -336,23 +338,31 @@ def setup_samdb_partitions(samdb_path, setup_path, message, lp, session_info,
else:
backend_modules = ["objectguid"]
- setup_add_ldif(samdb, setup_path("provision_partitions.ldif"), {
- "SCHEMADN": schemadn,
- "SCHEMADN_LDB": "schema.ldb",
- "SCHEMADN_MOD2": ",objectguid",
- "CONFIGDN": configdn,
- "CONFIGDN_LDB": "configuration.ldb",
- "DOMAINDN": domaindn,
- "DOMAINDN_LDB": "users.ldb",
- "SCHEMADN_MOD": "schema_fsmo,instancetype",
- "CONFIGDN_MOD": "naming_fsmo,instancetype",
- "DOMAINDN_MOD": "pdc_fsmo,password_hash,instancetype",
- "MODULES_LIST": ",".join(modules_list),
- "TDB_MODULES_LIST": ","+",".join(tdb_modules_list),
- "MODULES_LIST2": ",".join(modules_list2),
- "BACKEND_MOD": ",".join(backend_modules),
+ samdb.transaction_start()
+ try:
+ setup_add_ldif(samdb, setup_path("provision_partitions.ldif"), {
+ "SCHEMADN": schemadn,
+ "SCHEMADN_LDB": schemadn_ldb,
+ "SCHEMADN_MOD2": ",objectguid",
+ "CONFIGDN": configdn,
+ "CONFIGDN_LDB": configdn_ldb,
+ "DOMAINDN": domaindn,
+ "DOMAINDN_LDB": domaindn_ldb,
+ "SCHEMADN_MOD": "schema_fsmo,instancetype",
+ "CONFIGDN_MOD": "naming_fsmo,instancetype",
+ "DOMAINDN_MOD": "pdc_fsmo,password_hash,instancetype",
+ "MODULES_LIST": ",".join(modules_list),
+ "TDB_MODULES_LIST": ","+",".join(tdb_modules_list),
+ "MODULES_LIST2": ",".join(modules_list2),
+ "BACKEND_MOD": ",".join(backend_modules),
})
+ except:
+ samdb.transaction_cancel()
+ raise
+
+ samdb.transaction_commit()
+
samdb = SamDB(samdb_path, session_info=session_info,
credentials=credentials, lp=lp)
@@ -680,7 +690,7 @@ FILL_NT4SYNC = "NT4SYNC"
FILL_DRS = "DRS"
def provision(lp, setup_dir, message, paths, session_info,
- credentials, ldapbackend, samdb_fill=FILL_FULL, realm=None, rootdn=None,
+ credentials, samdb_fill=FILL_FULL, realm=None, rootdn=None,
domain=None, hostname=None, hostip=None, domainsid=None,
hostguid=None, adminpass=None, krbtgtpass=None, domainguid=None,
policyguid=None, invocationid=None, machinepass=None,