mgr/cephadm: fixing call method timeout handling

Fixes: https://tracker.ceph.com/issues/55265

Signed-off-by: Redouane Kachach <rkachach@redhat.com>
This commit is contained in:
Redouane Kachach 2022-04-11 16:13:05 +02:00
parent c82efef051
commit 55d42d0c31
No known key found for this signature in database
GPG Key ID: 843EE0E7D13F5049

View File

@ -1611,9 +1611,8 @@ def call(ctx: CephadmContext,
assert process.stdout
assert process.stderr
try:
stdout, stderr = await asyncio.gather(tee(process.stdout),
tee(process.stderr))
returncode = await asyncio.wait_for(process.wait(), timeout)
stdout, stderr = await asyncio.gather(tee(process.stdout), tee(process.stderr))
except asyncio.TimeoutError:
logger.info(prefix + f'timeout after {timeout} seconds')
return '', '', 124