Allow individual commands to control the response timeout

This commit is contained in:
Kovid Goyal
2021-10-30 12:20:37 +05:30
parent 66a7c3bc4d
commit c3daa969fa
3 changed files with 11 additions and 4 deletions

View File

@@ -152,7 +152,10 @@ def run_cmd(global_opts: RCOptions, cmd: str, func: RemoteCommand, opts: Any, it
}
if payload is not None:
send['payload'] = payload
response = do_io(global_opts.to, send, func.no_response)
response_timeout = func.response_timeout
if hasattr(opts, 'response_timeout'):
response_timeout = opts.response_timeout
response = do_io(global_opts.to, send, func.no_response, response_timeout)
if not response.get('ok'):
if response.get('tb'):
print_err(response['tb'])