Skip to content

Commit

Permalink
Merge pull request #2014 from ceph/wip-nitzan-add-timout-param-stop-type
Browse files Browse the repository at this point in the history
  • Loading branch information
zmc authored Jan 27, 2025
2 parents a98393b + cbef9c6 commit 38911de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions teuthology/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 38911de

Please sign in to comment.