python/samba: PY3 port samba4.blackbox.provision-backend
authorNoel Power <noel.power@suse.com>
Wed, 10 Oct 2018 11:21:10 +0000 (12:21 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 23 Oct 2018 03:50:29 +0000 (05:50 +0200)
convert ldif content to str when necessary

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/schema.py

index 6f71dd8fa4064f5d696ec4050cc7c3fd09dc3980..6aa0ddbe05c1913e6e0030b41ab18fe1b07e4095 100644 (file)
@@ -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.compat import get_string
 from samba import dsdb
 from ldb import SCOPE_SUBTREE, SCOPE_ONELEVEL
 import os
@@ -112,7 +113,8 @@ class Schema(object):
 
         if files is not None:
             for file in files:
-                self.schema_data += open(file, 'rb').read()
+                data = get_string(open(file, 'rb').read())
+                self.schema_data += data
 
         self.schema_data = substitute_var(self.schema_data,
                                           {"SCHEMADN": schemadn})