ceph/teuthology/task_util/rados.py
Josh Durgin 721280b7f3 task_util: move rados command here
Six copies are replaced with one, with an added option to check status
automatically. This should probably be used in a few places where the
return code is ignored.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-07-24 09:59:50 -07:00

26 lines
612 B
Python

import logging
from teuthology import misc as teuthology
log = logging.getLogger(__name__)
def rados(ctx, remote, cmd, wait=True, check_status=False):
testdir = teuthology.get_testdir(ctx)
log.info("rados %s" % ' '.join(cmd))
pre = [
'{tdir}/enable-coredump'.format(tdir=testdir),
'ceph-coverage',
'{tdir}/archive/coverage'.format(tdir=testdir),
'rados',
];
pre.extend(cmd)
proc = remote.run(
args=pre,
check_status=check_status,
wait=wait,
)
if wait:
return proc.exitstatus
else:
return proc