From 55b16c790bdb35ac5a99ff800222d9ff5a2326cf Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Tue, 30 Apr 2013 16:37:48 -0700 Subject: [PATCH] rgw: add to ctx.daemons so it can be stopped/started dynamically Name the daemon after the client it runs on, since only one per host is supported anyway. Signed-off-by: Josh Durgin --- teuthology/task/rgw.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/teuthology/task/rgw.py b/teuthology/task/rgw.py index 5b2f3be3acb8f..7f39b6b437e7d 100644 --- a/teuthology/task/rgw.py +++ b/teuthology/task/rgw.py @@ -142,30 +142,26 @@ def start_rgw(ctx, config): run_cmd.extend(run_cmd_tail) - proc = remote.run( + ctx.daemons.add_daemon( + remote, 'rgw', client, args=run_cmd, logger=log.getChild(client), stdin=run.PIPE, wait=False, ) - rgws[client] = proc try: yield finally: - log.info('Stopping rgw...') - for client, proc in rgws.iteritems(): - proc.stdin.close() - + teuthology.stop_daemons_of_type(ctx, 'rgw') + for client in config.iterkeys(): ctx.cluster.only(client).run( args=[ 'rm', - '-rf', + '-f', '{tdir}/rgw.opslog.sock'.format(tdir=testdir), - ], - ) - - run.wait(rgws.itervalues()) + ], + ) @contextlib.contextmanager -- 2.39.5