From b916f679824fd8ff1c6242af4c627b03ca098c4a Mon Sep 17 00:00:00 2001 From: Joe Buck Date: Thu, 6 Dec 2012 14:17:16 -0800 Subject: [PATCH] pexec.py: Parse out role ID from the back. Also, do not assume that the command needs to run from a specific directory. Signed-off-by: Joe Buck --- teuthology/task/pexec.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/teuthology/task/pexec.py b/teuthology/task/pexec.py index f629fcdf5c82f..048986a715acd 100644 --- a/teuthology/task/pexec.py +++ b/teuthology/task/pexec.py @@ -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() -- 2.39.5