Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion kubernetes/base/config/exec_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ def __init__(self, exec_config, cwd, cluster=None):
else:
self.cluster = None
self.cwd = cwd or None

@property
def shell(self):
# for windows systems `shell` should be `True`
# for other systems like linux or darwin `shell` should be `False`
# referenes:
# https://github.com/kubernetes-client/python/pull/2289
# https://docs.python.org/3/library/sys.html#sys.platform
return sys.platform in ("win32", "cygwin")

def run(self, previous_response=None):
is_interactive = hasattr(sys.stdout, 'isatty') and sys.stdout.isatty()
Expand All @@ -82,7 +91,7 @@ def run(self, previous_response=None):
cwd=self.cwd,
env=self.env,
universal_newlines=True,
shell=True)
shell=self.shell)
(stdout, stderr) = process.communicate()
exit_code = process.wait()
if exit_code != 0:
Expand Down