]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
task/pexec: More fixes for all case, exec on hosts
authorSam Lang <sam.lang@inktank.com>
Fri, 14 Dec 2012 17:30:15 +0000 (07:30 -1000)
committerSam Lang <sam.lang@inktank.com>
Tue, 8 Jan 2013 15:31:48 +0000 (09:31 -0600)
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 <sam.lang@inktank.com>
teuthology/task/pexec.py

index b9e5670d1b05eaf33ce7e7db42d4fe4c5fa0b170..0667dbfa473ab30de0bae60c5e64a010ff5bc206 100644 (file)
@@ -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)