python/samba/provision: PY3 port samba4.dlz_bind9.version
authorNoel Power <noel.power@suse.com>
Wed, 10 Oct 2018 15:34:52 +0000 (16:34 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 14 Nov 2018 04:07:15 +0000 (05:07 +0100)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/provision/sambadns.py

index 7fb42f6..9b24560 100644 (file)
@@ -60,7 +60,7 @@ from samba.provision.common import (
 )
 
 from samba.samdb import get_default_backend_store
-
+from samba.compat import get_string
 
 def get_domainguid(samdb, domaindn):
     res = samdb.search(base=domaindn, scope=ldb.SCOPE_BASE, attrs=["objectGUID"])
@@ -798,12 +798,12 @@ def create_samdb_copy(samdb, logger, paths, names, domainsid, domainguid):
                        scope=ldb.SCOPE_BASE,
                        attrs=["partition", "backendStore"])
     for tmp in res[0]["partition"]:
-        (nc, fname) = tmp.split(':')
+        (nc, fname) = str(tmp).split(':')
         partfile[nc.upper()] = fname
 
     backend_store = get_default_backend_store()
     if "backendStore" in res[0]:
-        backend_store = res[0]["backendStore"][0]
+        backend_store = str(res[0]["backendStore"][0])
 
     # Create empty domain partition
 
@@ -954,6 +954,7 @@ def create_named_conf(paths, realm, dnsdomain, dns_backend, logger):
                                      stdout=subprocess.PIPE,
                                      stderr=subprocess.STDOUT,
                                      cwd='.').communicate()[0]
+        bind_info = get_string(bind_info)
         bind9_8 = '#'
         bind9_9 = '#'
         bind9_10 = '#'