Skip to content

Commit 6bf7ccc

Browse files
BhaskarSrinivasKBhaskarSrinivasK
BhaskarSrinivasK
authored and
BhaskarSrinivasK
committed
Resolved the issue kubernetes-client#2356
1 parent dc9662d commit 6bf7ccc

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Diff for: kubernetes/base/config/exec_provider.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import os
1616
import subprocess
1717
import sys
18+
import platform
1819

1920
from .config_exception import ConfigException
2021

@@ -83,15 +84,17 @@ def run(self, previous_response=None):
8384
kubernetes_exec_info['spec']['cluster'] = self.cluster.value
8485

8586
self.env['KUBERNETES_EXEC_INFO'] = json.dumps(kubernetes_exec_info)
87+
is_windows = platform.system() == "Windows"
8688
process = subprocess.Popen(
87-
self.args,
88-
stdout=subprocess.PIPE,
89-
stderr=sys.stderr if is_interactive else subprocess.PIPE,
90-
stdin=sys.stdin if is_interactive else None,
91-
cwd=self.cwd,
92-
env=self.env,
93-
universal_newlines=True,
94-
shell=self.shell)
89+
self.args,
90+
stdout=subprocess.PIPE,
91+
stderr=sys.stderr if is_interactive else subprocess.PIPE,
92+
stdin=sys.stdin if is_interactive else None,
93+
cwd=self.cwd,
94+
env=self.env,
95+
universal_newlines=True,
96+
shell=is_windows # Only use shell=True on Windows
97+
)
9598
(stdout, stderr) = process.communicate()
9699
exit_code = process.wait()
97100
if exit_code != 0:

0 commit comments

Comments
 (0)