]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest/samba_tool_drs: Convert bytes to UTF-8 string
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 28 Feb 2023 04:02:52 +0000 (17:02 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 3 Mar 2023 01:07:36 +0000 (01:07 +0000)
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 <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/torture/drs/python/samba_tool_drs.py

index 8538c3041a45756376325e437fdd8bb19a5db30b..e9bb2c0ddb21066ec5d85fd7e08475e58f1b1b8d 100644 (file)
@@ -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),