s4/dsdb/tests/python: PY3 Port samba4.ldap.password_lockout
authorNoel Power <noel.power@suse.com>
Tue, 20 Nov 2018 15:10:35 +0000 (15:10 +0000)
committerNoel Power <npower@samba.org>
Mon, 10 Dec 2018 09:38:23 +0000 (10:38 +0100)
use Exception.args member as exception is no longer supports
indexing.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/tests/python/password_lockout.py

index 415f8f7065eeac4773a90b5ef5cd3c0c0811d095..e8ed73aa1dc4e6f8c4bb7a604ff1f7488e09977a 100755 (executable)
@@ -678,7 +678,7 @@ userPassword: thatsAcomplPASS2XYZ
                                     oldpassword="bad-password")
                 self.fail("Invalid SAMR change_password accepted")
             except NTSTATUSError as e:
-                enum = ctypes.c_uint32(e[0]).value
+                enum = ctypes.c_uint32(e.args[0]).value
                 self.assertEquals(enum, ntstatus.NT_STATUS_WRONG_PASSWORD)
 
             # check the status of the account is updated after each bad attempt
@@ -712,7 +712,7 @@ userPassword: thatsAcomplPASS2XYZ
                                     oldpassword=password)
                 self.fail("Invalid SAMR change_password accepted")
             except NTSTATUSError as e:
-                enum = ctypes.c_uint32(e[0]).value
+                enum = ctypes.c_uint32(e.args[0]).value
                 self.assertEquals(enum, ntstatus.NT_STATUS_ACCOUNT_LOCKED_OUT)
 
             res = self._check_account(userdn,