@@ -199,7 +199,7 @@ def test_client_join_stdout(self):
199199 self .assertTrue (len (_output ) == len (output ))
200200
201201 def test_pssh_client_no_stdout_non_zero_exit_code_immediate_exit (self ):
202- output = self .client .run_command ('exit 1' , return_list = True )
202+ output = self .client .run_command ('exit 1' )
203203 expected_exit_code = 1
204204 self .client .join (output )
205205 exit_code = output [0 ].exit_code
@@ -209,7 +209,7 @@ def test_pssh_client_no_stdout_non_zero_exit_code_immediate_exit(self):
209209 expected_exit_code ,))
210210
211211 def test_pssh_client_no_stdout_non_zero_exit_code_immediate_exit_no_join (self ):
212- output = self .client .run_command ('exit 1' , return_list = True )
212+ output = self .client .run_command ('exit 1' )
213213 expected_exit_code = 1
214214 for host_out in output :
215215 for line in host_out .stdout :
@@ -891,7 +891,7 @@ def test_identical_hosts_in_host_list(self):
891891 client = ParallelSSHClient (hosts , port = self .port ,
892892 pkey = self .user_key ,
893893 num_retries = 1 )
894- output = client .run_command (self .cmd , stop_on_errors = False , return_list = True )
894+ output = client .run_command (self .cmd , stop_on_errors = False )
895895 client .join (output )
896896 self .assertEqual (len (hosts ), len (output ),
897897 msg = "Host list contains %s identical hosts, only got output for %s" % (
@@ -1347,7 +1347,7 @@ def test_unknown_host_failure(self):
13471347 def test_open_channel_failure (self ):
13481348 client = ParallelSSHClient ([self .host ], port = self .port ,
13491349 pkey = self .user_key )
1350- output = client .run_command (self .cmd , return_list = True )
1350+ output = client .run_command (self .cmd )
13511351 client .join (output )
13521352 output [0 ].client .session .disconnect ()
13531353 self .assertRaises (SessionError , output [0 ].client .open_session )
@@ -1411,7 +1411,7 @@ def test_join_timeout_set_no_timeout(self):
14111411 def test_read_timeout (self ):
14121412 client = ParallelSSHClient ([self .host ], port = self .port ,
14131413 pkey = self .user_key )
1414- output = client .run_command ('sleep .3; echo me; echo me; echo me' , timeout = .2 )
1414+ output = client .run_command ('sleep .3; echo me; echo me; echo me' , read_timeout = .2 )
14151415 for host_out in output :
14161416 self .assertRaises (Timeout , list , host_out .stdout )
14171417 self .assertFalse (client .finished (output ))
@@ -1425,7 +1425,7 @@ def test_read_timeout(self):
14251425 def test_partial_read_timeout_close_cmd (self ):
14261426 self .assertTrue (self .client .finished ())
14271427 output = self .client .run_command ('while true; do echo a line; sleep .1; done' ,
1428- use_pty = True , timeout = .15 )
1428+ use_pty = True , read_timeout = .15 )
14291429 stdout = []
14301430 try :
14311431 with GTimeout (seconds = .25 ):
@@ -1473,8 +1473,6 @@ def test_partial_read_timeout_join_no_output(self):
14731473 else :
14741474 raise Exception ("Should have timed out" )
14751475 self .assertTrue (len (stdout ) > 0 )
1476- # Should be no-op
1477- self .client .reset_output_generators (output [0 ], timeout = None )
14781476 # Setting timeout
14791477 output [0 ].read_timeout = .2
14801478 stdout = []
@@ -1522,7 +1520,7 @@ def test_file_read_no_timeout(self):
15221520 with open (_file , 'wb' ) as fh :
15231521 fh .writelines (contents )
15241522 try :
1525- output = self .client .run_command ('cat %s' % (_file ,), timeout = 10 )
1523+ output = self .client .run_command ('cat %s' % (_file ,), read_timeout = 10 )
15261524 _out = list (output [0 ].stdout )
15271525 finally :
15281526 os .unlink (_file )
@@ -1830,11 +1828,11 @@ def test_multiple_join_timeout(self):
18301828 client = ParallelSSHClient ([self .host ], port = self .port ,
18311829 pkey = self .user_key )
18321830 for _ in range (5 ):
1833- output = client .run_command (self .cmd , return_list = True )
1831+ output = client .run_command (self .cmd )
18341832 client .join (output , timeout = 1 , consume_output = True )
18351833 for host_out in output :
18361834 self .assertTrue (host_out .client .finished (host_out .channel ))
1837- output = client .run_command ('sleep .2' , return_list = True )
1835+ output = client .run_command ('sleep .2' )
18381836 self .assertRaises (Timeout , client .join , output , timeout = .1 , consume_output = True )
18391837 for host_out in output :
18401838 self .assertFalse (host_out .client .finished (host_out .channel ))
@@ -1843,12 +1841,12 @@ def test_multiple_run_command_timeout(self):
18431841 client = ParallelSSHClient ([self .host ], port = self .port ,
18441842 pkey = self .user_key )
18451843 for _ in range (5 ):
1846- output = client .run_command ('pwd' , return_list = True , timeout = 1 )
1844+ output = client .run_command ('pwd' , read_timeout = 1 )
18471845 for host_out in output :
18481846 stdout = list (host_out .stdout )
18491847 self .assertTrue (len (stdout ) > 0 )
18501848 self .assertTrue (host_out .client .finished (host_out .channel ))
1851- output = client .run_command ('sleep .25; echo me' , return_list = True , timeout = .1 )
1849+ output = client .run_command ('sleep .25; echo me' , read_timeout = .1 )
18521850 for host_out in output :
18531851 self .assertRaises (Timeout , list , host_out .stdout )
18541852 client .join (output )
@@ -1893,7 +1891,7 @@ def test_read_stdout_no_timeout(self):
18931891 cmd = 'sleep .1; echo me; sleep .1; echo me'
18941892 read_timeout = 1
18951893 output = self .client .run_command (
1896- cmd , timeout = read_timeout , stop_on_errors = False )
1894+ cmd , read_timeout = read_timeout , stop_on_errors = False )
18971895 for host_out in output :
18981896 dt , timed_out = self .read_stream_dt (host_out , host_out .stdout , read_timeout )
18991897 self .assertFalse (timed_out )
@@ -1907,7 +1905,7 @@ def test_read_timeout_no_timeouts(self):
19071905 read_timeout = 1
19081906 # No timeouts
19091907 output = self .client .run_command (
1910- cmd , timeout = read_timeout , stop_on_errors = False , return_list = True )
1908+ cmd , read_timeout = read_timeout , stop_on_errors = False )
19111909 for host_out in output :
19121910 dt , timed_out = self .read_stream_dt (host_out , host_out .stdout , read_timeout )
19131911 self .assertTrue (dt .total_seconds () < read_timeout )
@@ -1917,11 +1915,11 @@ def test_read_timeout_no_timeouts(self):
19171915 self .assertTrue (dt .total_seconds () < read_timeout )
19181916
19191917 def test_read_stdout_timeout_stderr_no_timeout (self ):
1918+ """No timeouts for stderr only"""
19201919 cmd = 'sleep .1; echo me >&2; sleep .1; echo me >&2; sleep .1'
19211920 read_timeout = .25
1922- # No timeouts for stderr only
19231921 output = self .client .run_command (
1924- cmd , timeout = read_timeout , stop_on_errors = False )
1922+ cmd , read_timeout = read_timeout , stop_on_errors = False )
19251923 for host_out in output :
19261924 dt , timed_out = self .read_stream_dt (host_out , host_out .stdout , read_timeout )
19271925 self .assertTrue (timed_out )
0 commit comments