qa: move CephManager cluster instantiation to subtask

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>
This commit is contained in:
Patrick Donnelly 2021-10-05 13:31:02 -04:00
parent bca21f01ce
commit 7812cfb674
No known key found for this signature in database
GPG Key ID: BE69BB7D36E459B4

View 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']
@ -1866,6 +1880,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),
@ -1873,17 +1888,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']))