File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,16 @@ async def run_multiple_clients() -> None:
3333 tasks = (run_client (host , 'ls abc' ) for host in hosts )
3434 results = await asyncio .gather (* tasks , return_exceptions = True )
3535
36- for i , result in enumerate (results , 1 ):
36+ for i , result in enumerate (results ):
37+ task = f'Task { i + 1 } to host { hosts [i ]} '
38+
3739 if isinstance (result , Exception ):
38- print (f'Task { i } failed: { result } ' )
40+ print (f'{ task } failed: { result } ' )
3941 elif result .exit_status != 0 :
40- print (f'Task { i } exited with status { result .exit_status } :' )
42+ print (f'{ task } exited with status { result .exit_status } :' )
4143 print (result .stderr , end = '' )
4244 else :
43- print (f'Task { i } succeeded:' )
45+ print (f'{ task } succeeded:' )
4446 print (result .stdout , end = '' )
4547
4648 print (75 * '-' )
You can’t perform that action at this time.
0 commit comments