Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e852ac7

Browse filesBrowse files
committed
mark shell=False in ExecProvider for linux/darwin platforms
1 parent a5c3373 commit e852ac7
Copy full SHA for e852ac7

File tree

1 file changed

+10
-1
lines changed
Filter options

1 file changed

+10
-1
lines changed

‎kubernetes/base/config/exec_provider.py

Copy file name to clipboardExpand all lines: kubernetes/base/config/exec_provider.py
+10-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ def __init__(self, exec_config, cwd, cluster=None):
5858
else:
5959
self.cluster = None
6060
self.cwd = cwd or None
61+
62+
@property
63+
def shell(self):
64+
# for windows systems `shell` should be `True`
65+
# for other systems like linux or darwin `shell` should be `False`
66+
# referenes:
67+
# https://github.com/kubernetes-client/python/pull/2289
68+
# https://docs.python.org/3/library/sys.html#sys.platform
69+
return sys.platform in ("win32", "cygwin")
6170

6271
def run(self, previous_response=None):
6372
is_interactive = hasattr(sys.stdout, 'isatty') and sys.stdout.isatty()
@@ -82,7 +91,7 @@ def run(self, previous_response=None):
8291
cwd=self.cwd,
8392
env=self.env,
8493
universal_newlines=True,
85-
shell=True)
94+
shell=self.shell)
8695
(stdout, stderr) = process.communicate()
8796
exit_code = process.wait()
8897
if exit_code != 0:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.