From: Joseph Sutton Date: Tue, 28 Feb 2023 04:02:52 +0000 (+1300) Subject: pytest/samba_tool_drs: Convert bytes to UTF-8 string X-Git-Tag: talloc-2.4.1~1518 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bf6fa05b020d1833d9f02218088cbbd31e1b7cc;p=thirdparty%2Fsamba.git pytest/samba_tool_drs: Convert bytes to UTF-8 string We later use this variable as part of a string substitution, and if we leave it as bytes we will end up with b' ' quotes surrounding it, which we do not want. Fix this by converting it to a string. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source4/torture/drs/python/samba_tool_drs.py b/source4/torture/drs/python/samba_tool_drs.py index 8538c3041a4..e9bb2c0ddb2 100644 --- a/source4/torture/drs/python/samba_tool_drs.py +++ b/source4/torture/drs/python/samba_tool_drs.py @@ -360,7 +360,7 @@ class SambaToolDrsTests(drs_base.DrsBaseTestCase): self.assertEqual(ldap_service_name, server_ldap_service_name) server_dn = samdb.searchone("serverReferenceBL", "cn=%s,ou=domain controllers,%s" % (self.dc2, server_nc_name)).decode('utf8') - ntds_guid = samdb.searchone("objectGUID", "cn=ntds settings,%s" % server_dn) + ntds_guid = samdb.searchone("objectGUID", "cn=ntds settings,%s" % server_dn).decode('utf8') res = samdb.search(base=str(server_nc_name), expression="(&(objectclass=user)(cn=dns-%s))" % (self.dc2),