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:
# 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:
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"""
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):
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)