@@ -127,12 +127,12 @@ def _update_timeout_exception(self, ex, timeout=None):
127
127
def command (self , cmd ):
128
128
return RemoteExecutor .Command (cmd , self )
129
129
130
- def run_cmd (self , cmd , input_ = None , timeout = None ):
130
+ def run_cmd (self , cmd , input_ = None , timeout = None , get_pty = False ):
131
131
if self ._executor .sudo :
132
132
cmd .insert (0 , "sudo" )
133
133
134
134
cmd = self .command (cmd )
135
- return cmd .run (input_ , timeout )
135
+ return cmd .run (input_ , timeout , get_pty = get_pty )
136
136
137
137
@contextlib .contextmanager
138
138
def open_file (self , path , mode = 'r' , bufsize = - 1 ):
@@ -245,19 +245,28 @@ def session(self, timeout=None):
245
245
"""
246
246
return RemoteExecutor .Session (self , timeout )
247
247
248
- def run_cmd (self , cmd , input_ = None , tcp_timeout = None , io_timeout = None ):
248
+ def run_cmd (
249
+ self ,
250
+ cmd ,
251
+ input_ = None ,
252
+ tcp_timeout = None ,
253
+ io_timeout = None ,
254
+ get_pty = False
255
+ ):
249
256
"""
250
257
Args:
251
258
tcp_timeout (float): Tcp timeout
252
259
cmd (list): Command
253
260
input_ (str): Input data
254
261
io_timeout (float): Timeout for data operation (read/write)
262
+ get_pty (bool) : get pseudoterminal
263
+ (equivalent to passing -t arg to ssh)
255
264
256
265
Returns:
257
266
tuple (int, str, str): Rc, out, err
258
267
"""
259
268
with self .session (tcp_timeout ) as session :
260
- return session .run_cmd (cmd , input_ , io_timeout )
269
+ return session .run_cmd (cmd , input_ , io_timeout , get_pty = get_pty )
261
270
262
271
def is_connective (self , tcp_timeout = 20.0 ):
263
272
"""
0 commit comments