diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-02-05 10:34:51 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-02-07 13:22:01 +1100 |
commit | d1e5a7380619043a351ba8a25ebb8031163e70b7 (patch) | |
tree | dfb73691356940c847265086d7100286f864b010 /source4/scripting/python/samba/schema.py | |
parent | 4ae013c01b2936e7fd80e674a617f10b54179010 (diff) | |
download | samba-d1e5a7380619043a351ba8a25ebb8031163e70b7.tar.gz samba-d1e5a7380619043a351ba8a25ebb8031163e70b7.tar.bz2 samba-d1e5a7380619043a351ba8a25ebb8031163e70b7.zip |
s4-provision Remove setup_path, setup_dir and find_setup_dir
We now have a reliable way to know the current location of the
templates: dyn_SETUPDIR, which is updated for both the in-build and
installed binaries.
This replaces the function arguments and the distributed resolution of
the setup directory with one 'global' function (imported as required).
This also removes the ability to specify an alternate setup directory
on the command line, as this was rarely if ever used and never tested.
Andrew Bartlett
Diffstat (limited to 'source4/scripting/python/samba/schema.py')
-rw-r--r-- | source4/scripting/python/samba/schema.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/source4/scripting/python/samba/schema.py b/source4/scripting/python/samba/schema.py index c82e70daf6..8bac26e24f 100644 --- a/source4/scripting/python/samba/schema.py +++ b/source4/scripting/python/samba/schema.py @@ -62,13 +62,14 @@ def get_schema_descriptor(domain_sid): class Schema(object): - def __init__(self, setup_path, domain_sid, invocationid=None, schemadn=None, + def __init__(self, domain_sid, invocationid=None, schemadn=None, files=None, override_prefixmap=None, additional_prefixmap=None): + from samba.provision import setup_path + """Load schema for the SamDB from the AD schema files and samba4_schema.ldif :param samdb: Load a schema into a SamDB. - :param setup_path: Setup path function. :param schemadn: DN of the schema Returns the schema data loaded, to avoid double-parsing when then @@ -182,13 +183,11 @@ def get_dnsyntax_attributes(schemadn,schemaldb): return attributes -def ldb_with_schema(setup_dir=None, - schemadn="cn=schema,cn=configuration,dc=example,dc=com", - domainsid=None, - override_prefixmap=None): +def ldb_with_schema(schemadn="cn=schema,cn=configuration,dc=example,dc=com", + domainsid=None, + override_prefixmap=None): """Load schema for the SamDB from the AD schema files and samba4_schema.ldif - :param setup_dir: Setup path :param schemadn: DN of the schema :param serverdn: DN of the server @@ -197,12 +196,9 @@ def ldb_with_schema(setup_dir=None, operate without a remote or local schema. """ - def setup_path(file): - return os.path.join(setup_dir, file) - if domainsid is None: domainsid = security.random_sid() else: domainsid = security.dom_sid(domainsid) - return Schema(setup_path, domainsid, schemadn=schemadn, + return Schema(domainsid, schemadn=schemadn, override_prefixmap=override_prefixmap) |