res[0]["servicePrincipalName"] is an instance of ldb.bytes in PY3
If we wish to get the string value we need to call the custom
str function which attempts to decode the bytes to 'utf8'
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed by: Noel Power <npower@samba.org>
old_spns = []
if "servicePrincipalName" in res[0]:
for s in res[0]["servicePrincipalName"]:
- old_spns.append(s)
+ old_spns.append(str(s))
if opts.verbose:
print("Existing SPNs: %s" % old_spns)