g = yaml.safe_load_all(f)
for new in g:
ctx.teuthology_config.update(new)
+
+# return the "first" mon (alphanumerically, for lack of anything better)
+def get_first_mon(ctx, config):
+ mons = []
+ for remote, roles in ctx.cluster.remotes.items():
+ for role in roles:
+ if not role.startswith('mon.'):
+ continue
+ mons.append(role)
+ break
+ firstmon = sorted(mons)[0]
+ assert firstmon
+ return firstmon
),
)
-# return the "first" mon (alphanumerically, for lack of anything better)
-def get_first_mon(ctx, config):
- mons = []
- for remote, roles in ctx.cluster.remotes.items():
- for role in roles:
- if not role.startswith('mon.'):
- continue
- mons.append(role)
- break
- firstmon = sorted(mons)[0]
- assert firstmon
- return firstmon
-
@contextlib.contextmanager
def valgrind_post(ctx, config):
try:
coverage_dir = '/tmp/cephtest/archive/coverage'
- firstmon = get_first_mon(ctx, config)
+ firstmon = teuthology.get_first_mon(ctx, config)
log.info('Setting up %s...' % firstmon)
ctx.cluster.only(firstmon).run(
@contextlib.contextmanager
def mds(ctx, config):
log.info('Starting mds daemons...')
- firstmon = get_first_mon(ctx, config)
+ firstmon = teuthology.get_first_mon(ctx, config)
mds_daemons = {}
mdss = ctx.cluster.only(teuthology.is_type('mds'))
coverage_dir = '/tmp/cephtest/archive/coverage'
def healthy(ctx, config):
log.info('Waiting until ceph is healthy...')
- firstmon = get_first_mon(ctx, config)
+ firstmon = teuthology.get_first_mon(ctx, config)
(mon0_remote,) = ctx.cluster.only(firstmon).remotes.keys()
teuthology.wait_until_healthy(
remote=mon0_remote,
import contextlib
import logging
import ceph_manager
+from teuthology import misc as teuthology
+
log = logging.getLogger(__name__)
- interactive:
"""
log.info('Beginning thrashosds...')
- (mon,) = ctx.cluster.only('mon.0').remotes.iterkeys()
+ first_mon = teuthology.get_first_mon(ctx, config)
+ (mon,) = ctx.cluster.only(first_mon).remotes.iterkeys()
manager = ceph_manager.CephManager(
mon,
logger=log.getChild('ceph_manager'),