diff options
-rw-r--r-- | python/samba/netcmd/computer.py | 2 | ||||
-rw-r--r-- | python/samba/remove_dc.py | 2 | ||||
-rw-r--r-- | python/samba/samdb.py | 2 | ||||
-rw-r--r-- | python/samba/tests/samba_tool/computer.py | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/python/samba/netcmd/computer.py b/python/samba/netcmd/computer.py index 16e4bf8b5e6..ff4c3979e78 100644 --- a/python/samba/netcmd/computer.py +++ b/python/samba/netcmd/computer.py @@ -376,7 +376,7 @@ sudo is used so a computer may run the command as root. computer_dn = res[0].dn computer_ac = int(res[0]["userAccountControl"][0]) if "dNSHostName" in res[0]: - computer_dns_host_name = res[0]["dNSHostName"][0] + computer_dns_host_name = str(res[0]["dNSHostName"][0]) else: computer_dns_host_name = None except IndexError: diff --git a/python/samba/remove_dc.py b/python/samba/remove_dc.py index 3dc93741a45..fd14a596029 100644 --- a/python/samba/remove_dc.py +++ b/python/samba/remove_dc.py @@ -137,7 +137,7 @@ def remove_dns_references(samdb, logger, dnsHostName, ignore_no_name=False): # By using a set here, duplicates via (eg) example.com/Configuration # do not matter, they become just example.com a_names_to_remove_from \ - = set(dns_name_from_dn(dn) for dn in ncs) + = set(dns_name_from_dn(str(dn)) for dn in ncs) def a_rec_to_remove(dnsRecord): if dnsRecord.wType == DNS_TYPE_A or dnsRecord.wType == DNS_TYPE_AAAA: diff --git a/python/samba/samdb.py b/python/samba/samdb.py index 53f9c4038fa..fa3e4b1b334 100644 --- a/python/samba/samdb.py +++ b/python/samba/samdb.py @@ -743,7 +743,7 @@ accountExpires: %u def host_dns_name(self): """return the DNS name of this host""" res = self.search(base='', scope=ldb.SCOPE_BASE, attrs=['dNSHostName']) - return res[0]['dNSHostName'][0] + return str(res[0]['dNSHostName'][0]) def domain_dns_name(self): """return the DNS name of the domain root""" diff --git a/python/samba/tests/samba_tool/computer.py b/python/samba/tests/samba_tool/computer.py index 6a19926f368..8c5f332d461 100644 --- a/python/samba/tests/samba_tool/computer.py +++ b/python/samba/tests/samba_tool/computer.py @@ -186,7 +186,7 @@ class ComputerCmdTestCase(SambaToolCmdTest): for computerobj in computerlist: name = computerobj.get("samaccountname", idx=0) - found = self.assertMatch(out, name, + found = self.assertMatch(out, str(name), "computer '%s' not found" % name) def test_move(self): @@ -324,5 +324,5 @@ class ComputerCmdTestCase(SambaToolCmdTest): names = set() for computer in computer_list: for name in computer.get('servicePrincipalName', []): - names.add(name) + names.add(str(name)) return names == set(expected_service_principal_names) |