diff --git a/winrm_connector.py b/winrm_connector.py index 589820b..ea4a309 100644 --- a/winrm_connector.py +++ b/winrm_connector.py @@ -319,7 +319,7 @@ def _run_cmd(self, action_result, cmd, args=None, parse_callback=pc.basic, else: resp = self._session.run_cmd(cmd, args) except UnicodeDecodeError: - return action_result.set_status(phantom.APP_ERROR, "Error running command: {}".format(consts.WINRM_UNICODE_ERR_MESSAGE)) + return action_result.set_status(phantom.APP_ERROR, "Error running command: {}".format(consts.WINRM_UNICODE_ERR_MSG)) except Exception as e: return action_result.set_status(phantom.APP_ERROR, "Error running command: {}".format(unquote(self._get_error_message_from_exception(e)))) @@ -372,7 +372,7 @@ def _run_ps(self, action_result, script, parse_callback=pc.basic, additional_dat script = UnicodeDammit(script).unicode_markup resp = self._session.run_ps(script) except UnicodeDecodeError: - return action_result.set_status(phantom.APP_ERROR, "Error running PowerShell script: {}".format(consts.WINRM_UNICODE_ERR_MESSAGE)) + return action_result.set_status(phantom.APP_ERROR, "Error running PowerShell script: {}".format(consts.WINRM_UNICODE_ERR_MSG)) except Exception as e: return action_result.set_status(phantom.APP_ERROR, "Error running PowerShell script: {}".format(self._get_error_message_from_exception(e))) diff --git a/winrm_consts.py b/winrm_consts.py index a49da3f..d986d23 100644 --- a/winrm_consts.py +++ b/winrm_consts.py @@ -87,7 +87,7 @@ [Convert]::ToBase64String([IO.File]::ReadAllBytes($d)) """ -WINRM_UNICODE_ERR_MESSAGE = "Invalid unicode detected" +WINRM_UNICODE_ERR_MSG = "Invalid unicode detected" # Constants relating to '_validate_integer' WINRM_ERR_INVALID_INT = 'Please provide a valid {msg} integer value in the "{param}"'