]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pexec.py: Parse out role ID from the back.
authorJoe Buck <jbbuck@gmail.com>
Thu, 6 Dec 2012 22:17:16 +0000 (14:17 -0800)
committerJoe Buck <jbbuck@gmail.com>
Tue, 11 Dec 2012 22:07:28 +0000 (14:07 -0800)
Also, do not assume that the command needs to run from a specific directory.

Signed-off-by: Joe Buck <jbbuck@gmail.com>
teuthology/task/pexec.py

index f629fcdf5c82f6bf11f96105783a23bb2cbe5f65..048986a715acd5f5cfa925a957071cda868d1bae 100644 (file)
@@ -11,15 +11,13 @@ 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]
+    cid=role.split('.')[-1]
     args = ['bash', '-s']
     if sudo:
         args.insert(0, 'sudo')
     r = remote.run( args=args, stdin=tor.PIPE, wait=False)
     r.stdin.writelines(['set -e\n'])
     r.stdin.flush()
-    r.stdin.writelines(['cd /tmp/cephtest/mnt.{cid}\n'.format(cid=cid)])
-    r.stdin.flush()
     for l in ls:
         r.stdin.writelines([l, '\n'])
         r.stdin.flush()