]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest: remove py2 str/bytes workaround in lsa_utils
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 11 Jun 2024 23:14:42 +0000 (11:14 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 12 Jun 2024 08:14:34 +0000 (08:14 +0000)
It is likely not necessary to cast to list() in most cases.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/dcerpc/lsa_utils.py

index d6da5eb60bdfbf0791fdf1ac6e53d1bedc78c74c..229f57ec5468d3409cc584fa585ee9e27e6f1a52 100644 (file)
@@ -107,9 +107,7 @@ class CreateTrustedDomain(TestCase):
         info.trust_type = lsa.LSA_TRUST_TYPE_UPLEVEL
         info.trust_attributes = lsa.LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE
 
-        password_blob = samba.string_to_byte_array(
-            "password".encode('utf-16-le')
-        )
+        password_blob = list("password".encode('utf-16-le'))
 
         clear_value = drsblobs.AuthInfoClear()
         clear_value.size = len(password_blob)
@@ -198,9 +196,7 @@ class CreateTrustedDomain(TestCase):
         info.trust_type = lsa.LSA_TRUST_TYPE_UPLEVEL
         info.trust_attributes = lsa.LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE
 
-        password_blob = samba.string_to_byte_array(
-            "password".encode('utf-16-le')
-        )
+        password_blob = list("password".encode('utf-16-le'))
 
         clear_value = drsblobs.AuthInfoClear()
         clear_value.size = len(password_blob)