]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Refactor ceph healthy waiting into a separate subtask.
authorTommi Virtanen <tommi.virtanen@dreamhost.com>
Thu, 16 Jun 2011 19:18:58 +0000 (12:18 -0700)
committerTommi Virtanen <tommi.virtanen@dreamhost.com>
Thu, 16 Jun 2011 21:36:21 +0000 (14:36 -0700)
Note, not a context manager, just a task. There's no cleanup.

teuthology/task/ceph.py

index b887e0aa6ce7d1ddd6556d789c9bb1674c3c7198..538a5d9411591572bcb7d6a135e1d46c6ef3852e 100644 (file)
@@ -505,6 +505,14 @@ def mds(ctx, config):
         run.wait(mds_daemons.itervalues())
 
 
+def healthy(ctx, config):
+    log.info('Waiting until ceph is healthy...')
+    (mon0_remote,) = ctx.cluster.only('mon.0').remotes.keys()
+    teuthology.wait_until_healthy(
+        remote=mon0_remote,
+        )
+
+
 @contextlib.contextmanager
 def task(ctx, config):
     """
@@ -604,13 +612,7 @@ def task(ctx, config):
                 coverage=config.get('coverage'),
                 )),
         ):
-
-        log.info('Waiting until ceph is healthy...')
-        (mon0_remote,) = ctx.cluster.only('mon.0').remotes.keys()
-        teuthology.wait_until_healthy(
-            remote=mon0_remote,
-            )
-
+        healthy(ctx=ctx, config=None)
         yield
 
     if ctx.archive is not None: