From: Tim Beale Date: Tue, 30 Oct 2018 12:51:54 +0000 (+0000) Subject: s4/scripting/bin: PY3 convert servicePrincipalName attr to string X-Git-Tag: tdb-1.3.17~765 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48cc8a4e3214a571b2917dc3b677b44cccfa7286;p=thirdparty%2Fsamba.git s4/scripting/bin: PY3 convert servicePrincipalName attr to string 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 Reviewed-by: Andrew Bartlett Reviewed by: Noel Power --- diff --git a/source4/scripting/bin/samba_spnupdate b/source4/scripting/bin/samba_spnupdate index 69de3819751..a7ec0b96963 100755 --- a/source4/scripting/bin/samba_spnupdate +++ b/source4/scripting/bin/samba_spnupdate @@ -165,7 +165,7 @@ machine_dn = res[0]["dn"] 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)