From: Sam Lang Date: Fri, 14 Dec 2012 17:30:15 +0000 (-1000) Subject: task/pexec: More fixes for all case, exec on hosts X-Git-Tag: v0.94.10~27^2^2~364^2~1095 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=353200831076f739488bd9b7c8b1ee2d3fd9a505;p=ceph.git task/pexec: More fixes for all case, exec on hosts We don't want to do an exec per role, but per-host. We were already doing an exec per host, but the names were confusing. This fixes the names up and removes the role parameters. Signed-off-by: Sam Lang --- diff --git a/teuthology/task/pexec.py b/teuthology/task/pexec.py index b9e5670d1b05e..0667dbfa473ab 100644 --- a/teuthology/task/pexec.py +++ b/teuthology/task/pexec.py @@ -9,9 +9,8 @@ from teuthology.orchestra import run as tor log = logging.getLogger(__name__) -def _exec_role(remote, role, sudo, ls): - log.info('Running commands on role %s host %s', role, remote.name) - cid=role.split('.')[-1] +def _exec_host(remote, sudo, ls): + log.info('Running commands on host %s', remote.name) args = ['bash', '-s'] if sudo: args.insert(0, 'sudo') @@ -51,11 +50,12 @@ def task(ctx, config): del config['sudo'] if 'all' in config and len(config) == 1: + ls = config['all'] with parallel() as p: for remote in ctx.cluster.remotes.iterkeys(): - p.spawn(_exec_role, remote, role, sudo, ls) + p.spawn(_exec_host, remote, sudo, ls) else: with parallel() as p: for role, ls in config.iteritems(): (remote,) = ctx.cluster.only(role).remotes.iterkeys() - p.spawn(_exec_role, remote, role, sudo, ls) + p.spawn(_exec_host, remote, sudo, ls)