]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: move CephManager cluster instantiation to subtask
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 5 Oct 2021 17:31:02 +0000 (13:31 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 15 Oct 2021 01:10:51 +0000 (21:10 -0400)
This needs to be available for the cephfs_setup task so administration
mounts can run ceph commands, potentially through `cephadm shell`.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 7812cfb6744fc3bce50e26aa7dd6a4e47a43bb23)

qa/tasks/ceph.py

index 48e2f91cb8b4d56876964aea8d9931a421c3e86f..a6eab9be808a2fd7fab4619f56bf99470045a027 100644 (file)
@@ -376,6 +376,20 @@ def crush_setup(ctx, config):
     yield
 
 
+@contextlib.contextmanager
+def setup_manager(ctx, config):
+    first_mon = teuthology.get_first_mon(ctx, config, config['cluster'])
+    (mon,) = ctx.cluster.only(first_mon).remotes.keys()
+    if not hasattr(ctx, 'managers'):
+        ctx.managers = {}
+    ctx.managers[config['cluster']] = CephManager(
+        mon,
+        ctx=ctx,
+        logger=log.getChild('ceph_manager.' + config['cluster']),
+        cluster=config['cluster'],
+    )
+    yield
+
 @contextlib.contextmanager
 def create_rbd_pool(ctx, config):
     cluster_name = config['cluster']
@@ -1870,6 +1884,7 @@ def task(ctx, config):
         lambda: run_daemon(ctx=ctx, config=config, type_='mgr'),
         lambda: crush_setup(ctx=ctx, config=config),
         lambda: run_daemon(ctx=ctx, config=config, type_='osd'),
+        lambda: setup_manager(ctx=ctx, config=config),
         lambda: create_rbd_pool(ctx=ctx, config=config),
         lambda: run_daemon(ctx=ctx, config=config, type_='mds'),
         lambda: cephfs_setup(ctx=ctx, config=config),
@@ -1877,17 +1892,6 @@ def task(ctx, config):
     ]
 
     with contextutil.nested(*subtasks):
-        first_mon = teuthology.get_first_mon(ctx, config, config['cluster'])
-        (mon,) = ctx.cluster.only(first_mon).remotes.keys()
-        if not hasattr(ctx, 'managers'):
-            ctx.managers = {}
-        ctx.managers[config['cluster']] = CephManager(
-            mon,
-            ctx=ctx,
-            logger=log.getChild('ceph_manager.' + config['cluster']),
-            cluster=config['cluster'],
-        )
-
         try:
             if config.get('wait-for-healthy', True):
                 healthy(ctx=ctx, config=dict(cluster=config['cluster']))