]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology/misc: Add timeout parameter to stop_daemons_of_type for better flexibility 2014/head
authorNitzan Mordechai <nmordech@redhat.com>
Tue, 10 Dec 2024 06:12:00 +0000 (06:12 +0000)
committerNitzan Mordechai <nmordech@redhat.com>
Tue, 10 Dec 2024 13:43:22 +0000 (13:43 +0000)
Updated stop_daemons_of_type to accept a timeout parameter,
allowing dynamic control over the timeout value passed to the
stop function of each daemon.

Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
teuthology/misc.py

index 97521895ac655ba4189cec0d38c02bccd36dba9e..eeab7be5bc620cd1ddc0e821b49c2e8f88e4d2fc 100644 (file)
@@ -1148,15 +1148,17 @@ def ssh_keyscan_wait(hostname):
             log.info("try ssh_keyscan again for " + str(hostname))
         return success
 
-def stop_daemons_of_type(ctx, type_, cluster='ceph'):
+def stop_daemons_of_type(ctx, type_, cluster='ceph', timeout=300):
     """
     :param type_: type of daemons to be stopped.
+    :param cluster: Cluster name, default is 'ceph'.
+    :param timeout: Timeout in seconds for stopping each daemon.
     """
     log.info('Shutting down %s daemons...' % type_)
     exc = None
     for daemon in ctx.daemons.iter_daemons_of_role(type_, cluster):
         try:
-            daemon.stop()
+            daemon.stop(timeout)
         except (CommandFailedError,
                 CommandCrashedError,
                 ConnectionLostError) as e: