diff options
| author | Jelmer Vernooij <jelmer@samba.org> | 2010-06-20 01:43:51 +0200 | 
|---|---|---|
| committer | Jelmer Vernooij <jelmer@samba.org> | 2010-06-20 02:46:56 +0200 | 
| commit | d3d7ff66d4a7952a50e7d9175528985358cb3522 (patch) | |
| tree | 352526aa7ea2dbdc2e97a3b09b95bb6d000e1c7c /source4/scripting/python | |
| parent | afad634207ecdc5e67386e857ff3b9d5d7acd1ac (diff) | |
| download | samba-d3d7ff66d4a7952a50e7d9175528985358cb3522.tar.gz samba-d3d7ff66d4a7952a50e7d9175528985358cb3522.tar.bz2 samba-d3d7ff66d4a7952a50e7d9175528985358cb3522.zip  | |
Move convert_to_openldap onto Schema class.
Diffstat (limited to 'source4/scripting/python')
| -rw-r--r-- | source4/scripting/python/samba/__init__.py | 3 | ||||
| -rw-r--r-- | source4/scripting/python/samba/provisionbackend.py | 4 | ||||
| -rw-r--r-- | source4/scripting/python/samba/schema.py | 5 | 
3 files changed, 7 insertions, 5 deletions
diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py index 25b8ff9c3d..ca433127ba 100644 --- a/source4/scripting/python/samba/__init__.py +++ b/source4/scripting/python/samba/__init__.py @@ -286,9 +286,6 @@ class Ldb(_Ldb):      def write_prefixes_from_schema(self):          dsdb.dsdb_write_prefixes_from_schema_to_ldb(self) -    def convert_schema_to_openldap(self, target, mapping): -        return dsdb.dsdb_convert_schema_to_openldap(self, target, mapping) -  def substitute_var(text, values):      """Substitute strings of the form ${NAME} in str, replacing diff --git a/source4/scripting/python/samba/provisionbackend.py b/source4/scripting/python/samba/provisionbackend.py index a40a4b347a..ccb793f3e5 100644 --- a/source4/scripting/python/samba/provisionbackend.py +++ b/source4/scripting/python/samba/provisionbackend.py @@ -484,7 +484,7 @@ class OpenLDAPBackend(LDAPBackend):          backend_schema = "backend-schema.schema"          f = open(self.setup_path(mapping), 'r') -        backend_schema_data = self.schema.ldb.convert_schema_to_openldap( +        backend_schema_data = self.schema.convert_to_openldap(                  "openldap", f.read())          assert backend_schema_data is not None          f = open(os.path.join(self.ldapdir, backend_schema), 'w') @@ -686,7 +686,7 @@ class FDSBackend(LDAPBackend):          backend_schema = "99_ad.ldif"          # Build a schema file in Fedora DS format -        backend_schema_data = self.schema.ldb.convert_schema_to_openldap("fedora-ds", open(self.setup_path(mapping), 'r').read()) +        backend_schema_data = self.schema.convert_to_openldap("fedora-ds", open(self.setup_path(mapping), 'r').read())          assert backend_schema_data is not None          f = open(os.path.join(self.ldapdir, backend_schema), 'w')          try: diff --git a/source4/scripting/python/samba/schema.py b/source4/scripting/python/samba/schema.py index bffb0e53da..2495cf2e0c 100644 --- a/source4/scripting/python/samba/schema.py +++ b/source4/scripting/python/samba/schema.py @@ -28,6 +28,7 @@ from samba.dcerpc import security  from samba.ms_schema import read_ms_schema  from samba.ndr import ndr_pack  from samba.samdb import SamDB +from samba import dsdb  from ldb import SCOPE_SUBTREE, SCOPE_ONELEVEL  import os @@ -135,6 +136,10 @@ dn: @INDEXLIST      def dnsyntax_attributes(self):          return get_dnsyntax_attributes(self.schemadn, self.ldb) +    def convert_to_openldap(self, target, mapping): +        return dsdb.dsdb_convert_schema_to_openldap(self.ldb, target, mapping) + +  # Return a hash with the forward attribute as a key and the back as the value   def get_linked_attributes(schemadn,schemaldb):      attrs = ["linkID", "lDAPDisplayName"]  | 
