]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
rgw: add to ctx.daemons so it can be stopped/started dynamically
authorJosh Durgin <josh.durgin@inktank.com>
Tue, 30 Apr 2013 23:37:48 +0000 (16:37 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Tue, 30 Apr 2013 23:37:48 +0000 (16:37 -0700)
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>
teuthology/task/rgw.py

index 5b2f3be3acb8f88cb2c9788c2a167f79294fba10..7f39b6b437e7dbcac03938e06403335c3cf3474f 100644 (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