],
)
-def get_clients(ctx, roles):
- for role in roles:
- assert isinstance(role, basestring)
- PREFIX = 'client.'
- assert role.startswith(PREFIX)
- id_ = role[len(PREFIX):]
- (remote,) = ctx.cluster.only(role).remotes.iterkeys()
- yield (id_, remote)
+# return id, remote dictionary for the clients listed in config
+def get_clients(ctx, config):
+ clients = []
+ crem = ctx.cluster.only(is_type('client'))
+ for client in config:
+ assert client.startswith('client.')
+ id = client[len('client.'):]
+ for remote, roles in crem.remotes.iteritems():
+ if client in roles:
+ clients.append((id, remote))
+ return clients
def get_user():
return getpass.getuser() + '@' + socket.gethostname()
)
log.info('Setting up client nodes...')
+
clients = ctx.cluster.only(teuthology.is_type('client'))
for remote, roles_for_host in clients.remotes.iteritems():
for id_ in teuthology.roles_of_type(roles_for_host, 'client'):
+ log.info('id %s remote %s' % (id_, remote))
remote.run(
args=[
'/tmp/cephtest/enable-coredump',
if config is None:
config = ['client.{id}'.format(id=id_)
for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')]
- clients = list(teuthology.get_clients(ctx=ctx, roles=config))
+ clients = teuthology.get_clients(ctx=ctx, config=config)
for id_, remote in clients:
mnt = os.path.join('/tmp/cephtest', 'mnt.{id}'.format(id=id_))
remote.run(
if config is None:
config = ['client.{id}'.format(id=id_)
for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')]
- clients = list(teuthology.get_clients(ctx=ctx, roles=config))
+ clients = teuthology.get_clients(ctx=ctx, config=config)
for id_, remote in clients:
log.debug('Mounting client client.{id}...'.format(id=id_))
remotes_and_roles = ctx.cluster.remotes.items()