Skip to content

Commit

Permalink
Merge pull request #78 from rundeck-plugins/issue/1869_fails-with-per…
Browse files Browse the repository at this point in the history
…cent-character

Fixed percent charater issue when vommand is a job option
  • Loading branch information
ltamaster authored Jul 27, 2021
2 parents cfec922 + 6797312 commit eb726b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contents/winrm_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
PY3 = sys.version_info[0] == 3
PY34 = sys.version_info[0:2] >= (3, 4)
RD = "RD_"
RD_COMMAND = "RD_EXEC_COMMAND"
INVALID_CHAR = "%"

if PY3:
string_types = str,
Expand All @@ -55,7 +55,7 @@ def run_cmd(self, command, args=(), out_stream=None, err_stream=None):

envs = {}
for a in os.environ:
if a.startswith(RD) and a != RD_COMMAND:
if a.startswith(RD) and INVALID_CHAR not in os.environ[a]:
envs.update({a:os.getenv(a)})

# TODO optimize perf. Do not call open/close shell every time
Expand Down

0 comments on commit eb726b7

Please sign in to comment.