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 <josh.durgin@inktank.com>
This commit is contained in:
Josh Durgin 2013-04-30 16:37:48 -07:00
parent 4979df32c5
commit 55b16c790b

View File

@ -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