From 353200831076f739488bd9b7c8b1ee2d3fd9a505 Mon Sep 17 00:00:00 2001 From: Sam Lang Date: Fri, 14 Dec 2012 07:30:15 -1000 Subject: [PATCH] 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 --- teuthology/task/pexec.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/teuthology/task/pexec.py b/teuthology/task/pexec.py index b9e5670d1b..0667dbfa47 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) -- 2.39.5