Skip to content

Commit

Permalink
Fixed percent charater issue when vommand is a job option
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Abarca committed Jul 26, 2021
1 parent b163192 commit 6797312
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 6797312

Please sign in to comment.