From 73be005f6a945af87752f8474ec85348da5c7fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Fri, 5 Oct 2018 12:41:23 +0200 Subject: [PATCH] changed error message on case of change user password error --- actors/src/udsactor/windows/operations.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/actors/src/udsactor/windows/operations.py b/actors/src/udsactor/windows/operations.py index da65b90a..c211c836 100644 --- a/actors/src/udsactor/windows/operations.py +++ b/actors/src/udsactor/windows/operations.py @@ -91,6 +91,7 @@ def getDomainName(): def getWindowsVersion(): return win32api.GetVersionEx() + EWX_LOGOFF = 0x00000000 EWX_SHUTDOWN = 0x00000001 EWX_REBOOT = 0x00000002 @@ -121,6 +122,7 @@ def renameComputer(newName): computerName = win32api.GetComputerNameEx(win32con.ComputerNamePhysicalDnsHostname) raise Exception('Error renaming computer from {} to {}: {}'.format(computerName, newName, error)) + NETSETUP_JOIN_DOMAIN = 0x00000001 NETSETUP_ACCT_CREATE = 0x00000002 NETSETUP_ACCT_DELETE = 0x00000004 @@ -187,8 +189,8 @@ def changeUserPassword(user, oldPassword, newPassword): if res != 0: # Log the error, and raise exception to parent - error = getErrorMessage() - raise Exception('Error changing password for user {}: {}'.format(user.value, error)) + error = getErrorMessage(res) + raise Exception('Error changing password for user {}: {} {}'.format(user.value, res, error)) class LASTINPUTINFO(ctypes.Structure):