mirror of
https://github.com/ceph/ceph
synced 2025-04-08 10:42:01 +00:00
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:
parent
bca21f01ce
commit
7812cfb674
@ -376,6 +376,20 @@ def crush_setup(ctx, config):
|
|||||||
yield
|
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
|
@contextlib.contextmanager
|
||||||
def create_rbd_pool(ctx, config):
|
def create_rbd_pool(ctx, config):
|
||||||
cluster_name = config['cluster']
|
cluster_name = config['cluster']
|
||||||
@ -1866,6 +1880,7 @@ def task(ctx, config):
|
|||||||
lambda: run_daemon(ctx=ctx, config=config, type_='mgr'),
|
lambda: run_daemon(ctx=ctx, config=config, type_='mgr'),
|
||||||
lambda: crush_setup(ctx=ctx, config=config),
|
lambda: crush_setup(ctx=ctx, config=config),
|
||||||
lambda: run_daemon(ctx=ctx, config=config, type_='osd'),
|
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: create_rbd_pool(ctx=ctx, config=config),
|
||||||
lambda: run_daemon(ctx=ctx, config=config, type_='mds'),
|
lambda: run_daemon(ctx=ctx, config=config, type_='mds'),
|
||||||
lambda: cephfs_setup(ctx=ctx, config=config),
|
lambda: cephfs_setup(ctx=ctx, config=config),
|
||||||
@ -1873,17 +1888,6 @@ def task(ctx, config):
|
|||||||
]
|
]
|
||||||
|
|
||||||
with contextutil.nested(*subtasks):
|
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:
|
try:
|
||||||
if config.get('wait-for-healthy', True):
|
if config.get('wait-for-healthy', True):
|
||||||
healthy(ctx=ctx, config=dict(cluster=config['cluster']))
|
healthy(ctx=ctx, config=dict(cluster=config['cluster']))
|
||||||
|
Loading…
Reference in New Issue
Block a user