python/samba/provision: PY3 port samba4.blackbox.provision-backend
authorNoel Power <noel.power@suse.com>
Wed, 10 Oct 2018 11:18:32 +0000 (12:18 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 23 Oct 2018 03:50:29 +0000 (05:50 +0200)
Fix some attibrutes that need to be treated as str

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

index 4d11690a7672f09888aba5cebbb55b214029efc6..e46e3e86ba128cb5df456e8385472db56beeae29 100644 (file)
@@ -382,7 +382,7 @@ class OpenLDAPBackend(LDAPBackend):
             base=self.names.schemadn, scope=SCOPE_ONELEVEL, attrs=attrs)
         index_config = ""
         for i in range(0, len(res)):
-            index_attr = res[i]["lDAPDisplayName"][0]
+            index_attr = str(res[i]["lDAPDisplayName"][0])
             if index_attr == "objectGUID":
                 index_attr = "entryUUID"
 
@@ -745,7 +745,7 @@ class FDSBackend(LDAPBackend):
             base=self.names.schemadn, scope=SCOPE_ONELEVEL, attrs=attrs)
 
         for i in range(0, len(res)):
-            attr = res[i]["lDAPDisplayName"][0]
+            attr = str(res[i]["lDAPDisplayName"][0])
 
             if attr == "objectGUID":
                 attr = "nsUniqueId"