summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/schema.py
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-06-10 08:58:44 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-06-12 11:18:36 +1000
commit57b6979ad034b50debd47979e05b925daa54b5a4 (patch)
treed445dedfc9b9899569eb4e64bf9461bffd21f5d3 /source4/scripting/python/samba/schema.py
parent6336f244758e78dfce61715b5de403e3db7fb02e (diff)
downloadsamba-57b6979ad034b50debd47979e05b925daa54b5a4.tar.gz
samba-57b6979ad034b50debd47979e05b925daa54b5a4.tar.xz
samba-57b6979ad034b50debd47979e05b925daa54b5a4.zip
s4:provision Allow both additional and override prefixmaps in Schema
The idea here is to allow some callers to specify a new prefixMap that will override the values loaded from the prefixMap.txt. Andrew Bartlett
Diffstat (limited to 'source4/scripting/python/samba/schema.py')
-rw-r--r--source4/scripting/python/samba/schema.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/source4/scripting/python/samba/schema.py b/source4/scripting/python/samba/schema.py
index fc4f131932..bdc09cfd3a 100644
--- a/source4/scripting/python/samba/schema.py
+++ b/source4/scripting/python/samba/schema.py
@@ -53,7 +53,7 @@ def get_schema_descriptor(domain_sid):
class Schema(object):
def __init__(self, setup_path, domain_sid, invocationid=None, schemadn=None,
- serverdn=None, files=None, prefixmap=None, am_rodc=False):
+ serverdn=None, files=None, override_prefixmap=None, additional_prefixmap=None, am_rodc=False):
"""Load schema for the SamDB from the AD schema files and samba4_schema.ldif
:param samdb: Load a schema into a SamDB.
@@ -92,10 +92,13 @@ class Schema(object):
setup_path("provision_schema_basedn.ldif"),
{"SCHEMADN": schemadn, "DESCRIPTOR": descr})
- self.prefixmap_data = open(setup_path("prefixMap.txt"), 'r').read()
+ if override_prefixmap is not None:
+ self.prefixmap_data = override_prefixmap
+ else:
+ self.prefixmap_data = open(setup_path("prefixMap.txt"), 'r').read()
- if prefixmap is not None:
- for map in prefixmap:
+ if additional_prefixmap is not None:
+ for map in additional_prefixmap:
self.prefixmap_data += "%s\n" % map
self.prefixmap_data = b64encode(self.prefixmap_data)