File tree 1 file changed +11
-8
lines changed
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 15
15
import os
16
16
import subprocess
17
17
import sys
18
+ import platform
18
19
19
20
from .config_exception import ConfigException
20
21
@@ -83,15 +84,17 @@ def run(self, previous_response=None):
83
84
kubernetes_exec_info ['spec' ]['cluster' ] = self .cluster .value
84
85
85
86
self .env ['KUBERNETES_EXEC_INFO' ] = json .dumps (kubernetes_exec_info )
87
+ is_windows = platform .system () == "Windows"
86
88
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
+ )
95
98
(stdout , stderr ) = process .communicate ()
96
99
exit_code = process .wait ()
97
100
if exit_code != 0 :
You can’t perform that action at this time.
0 commit comments