]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cephadm: fix timeout argument to call function
authorJohn Mulligan <jmulligan@redhat.com>
Mon, 27 Feb 2023 19:38:50 +0000 (14:38 -0500)
committerAdam King <adking@redhat.com>
Tue, 25 Apr 2023 12:36:54 +0000 (08:36 -0400)
commitbeacebb5d20bb53cca1de50655c32f41a95e3eb4
tree5e04de5af351cdb75787577b97234f9a9eb9819b
parent63c906fd4ea8e567f7540a15e1c2323e5f28c92a
cephadm: fix timeout argument to call function

The timeout argument to call function, for executing sub-processes, did
not function - this patch makes timeout work as (probably) intended.
Use the `process.communicate()` method rather than `tee` functions to
handle IO collection. Since no logging is done until after the exit code
is known the tee calls are not necessary. Add calls to kill the child
process when the time out occurs. This helps prevent event loop "leaks"
that generate python warnings.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit cefe44cde8d53d7bfd935435f87205a01d677986)
src/cephadm/cephadm.py