Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSE-321: Fix: ERROR while running a dir command in a path with Japanese files #94

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

L2JE
Copy link
Contributor

@L2JE L2JE commented Feb 23, 2023

Ticket: https://pagerduty.atlassian.net/browse/RSE-321

Problem

Steps to Reproduce:

  1. Deploy a windows 12 japanese version
  2. Create fail.wsf file that has a runtime error like dividing by zero.
  3. Setup winrm on the node and pywinrm dependancies on rundeck
  4. Add the windows machine as a rundeck node
node_win_xmpl:
  nodename: node_win_xmpl
  hostname: 127.0.0.1
  osArch: amd64
  username: Administrator
  osFamily: windows
  node-executor: WinRMPython
  file-copier: WinRMcpPython
  winrm-password-storage-path: keys/windows/winrm-admin.password
  output-charset: 'shift_jis'
  1. From the command tab, run the script with: dir C:\
  2. See job failing with no logs showing a reason
    image

Solution

  • Use utf-8 as an internal default charset to try printing any output that couldn't be decoded using the defined node's output-charset.
  • Handle exceptions and log them as error to let the user know why and where any error occurred.

@robotarmy
Copy link

<3 <3 <3 <3

@L2JE L2JE marked this pull request as ready for review March 22, 2023 14:51
@ronaveva ronaveva self-requested a review March 22, 2023 15:21
Copy link

@ronaveva ronaveva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants