diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-08-26 13:43:33 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-08-26 13:49:10 +1000 |
commit | a1da91174b8db082c42ec7e8a6438e11e0e56e91 (patch) | |
tree | bc41b8eb1dfdd0beadb9b098456b62432b57874e /source4/scripting/python/samba/provision.py | |
parent | b9ec6bb1eb02121f43498681b99891dc17505512 (diff) | |
download | samba-a1da91174b8db082c42ec7e8a6438e11e0e56e91.tar.gz samba-a1da91174b8db082c42ec7e8a6438e11e0e56e91.tar.xz samba-a1da91174b8db082c42ec7e8a6438e11e0e56e91.zip |
s4:provison Add prefixes to ldb using same code a later modify will use
This allows us to test out the code that will do the modify of the
prefixMap, and to provide the bindings that may assist a future
upgrade script.
Andrew Bartlett
Diffstat (limited to 'source4/scripting/python/samba/provision.py')
-rw-r--r-- | source4/scripting/python/samba/provision.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index aa6b6789dd..a8cedaf23a 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -151,18 +151,21 @@ class Schema(object): self.schema_data += open(setup_path("schema_samba4.ldif"), 'r').read() self.schema_data = substitute_var(self.schema_data, {"SCHEMADN": schemadn}) check_all_substituted(self.schema_data) - prefixmap = open(setup_path("prefixMap.txt"), 'r').read() - prefixmap = b64encode(prefixmap) - + self.schema_dn_modify = read_and_sub_file(setup_path("provision_schema_basedn_modify.ldif"), {"SCHEMADN": schemadn, - "PREFIXMAP_B64": prefixmap, "SERVERDN": serverdn, }) self.schema_dn_add = read_and_sub_file(setup_path("provision_schema_basedn.ldif"), {"SCHEMADN": schemadn }) - self.ldb.set_schema_from_ldif(self.schema_dn_modify, self.schema_data) + + prefixmap = open(setup_path("prefixMap.txt"), 'r').read() + prefixmap = b64encode(prefixmap) + + # We don't actually add this ldif, just parse it + prefixmap_ldif = "dn: cn=schema\nprefixMap:: %s\n\n" % prefixmap + self.ldb.set_schema_from_ldif(prefixmap_ldif, self.schema_data) def check_install(lp, session_info, credentials): @@ -910,6 +913,7 @@ def setup_samdb(path, setup_path, session_info, credentials, lp, message("Setting up sam.ldb schema") samdb.add_ldif(schema.schema_dn_add) samdb.modify_ldif(schema.schema_dn_modify) + samdb.write_prefixes_from_schema() samdb.add_ldif(schema.schema_data) setup_add_ldif(samdb, setup_path("aggregate_schema.ldif"), {"SCHEMADN": names.schemadn}) |