python:tests: Rewrite condition of while loop
authorJo Sutton <josutton@catalyst.net.nz>
Wed, 24 Apr 2024 01:37:40 +0000 (13:37 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 24 Apr 2024 05:16:29 +0000 (05:16 +0000)
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/dckeytab.py

index a4ae38a8c0bc786cb69f45381966c40140f02388..ca0dbcf7f2a27ef31ad7e799500acd49958b9c84 100644 (file)
@@ -67,7 +67,7 @@ class DCKeytabTests(TestCaseInTempDir):
         keytab_as_set.add(entry_as_tuple)
 
         keytab_bytes = keytab.further_entry
-        while True:
+        while keytab_bytes:
             multiple_entry = ndr_unpack(krb5ccache.MULTIPLE_KEYTAB_ENTRIES, keytab_bytes)
             entry = multiple_entry.entry
             entry_as_tuple = entry_to_tuple(entry)
@@ -75,8 +75,6 @@ class DCKeytabTests(TestCaseInTempDir):
             keytab_as_set.add(entry_as_tuple)
 
             keytab_bytes = multiple_entry.further_entry
-            if not keytab_bytes:
-                break
 
         return keytab_as_set