From 48cc8a4e3214a571b2917dc3b677b44cccfa7286 Mon Sep 17 00:00:00 2001 From: Tim Beale Date: Tue, 30 Oct 2018 12:51:54 +0000 Subject: [PATCH] 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 --- source4/scripting/bin/samba_spnupdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.47.2