diff options
author | Qiaowei Ren <qiaowei.ren@intel.com> | 2018-03-01 14:38:11 +0800 |
---|---|---|
committer | Qiaowei Ren <qiaowei.ren@intel.com> | 2018-03-01 14:38:11 +0800 |
commit | 7da45d65be36d36b880cc55c5036e96c24b53f00 (patch) | |
tree | d4f944eb4f8f8de50a9a7584ffa408dc3a3185b2 /src/ceph/qa/tasks/exec_on_cleanup.py | |
parent | 691462d09d0987b47e112d6ee8740375df3c51b2 (diff) |
remove ceph code
This patch removes initial ceph code, due to license issue.
Change-Id: I092d44f601cdf34aed92300fe13214925563081c
Signed-off-by: Qiaowei Ren <qiaowei.ren@intel.com>
Diffstat (limited to 'src/ceph/qa/tasks/exec_on_cleanup.py')
-rw-r--r-- | src/ceph/qa/tasks/exec_on_cleanup.py | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/src/ceph/qa/tasks/exec_on_cleanup.py b/src/ceph/qa/tasks/exec_on_cleanup.py deleted file mode 100644 index e3c09d5..0000000 --- a/src/ceph/qa/tasks/exec_on_cleanup.py +++ /dev/null @@ -1,62 +0,0 @@ -""" -Exececute custom commands during unwind/cleanup -""" -import logging -import contextlib - -from teuthology import misc as teuthology -from teuthology import contextutil - -log = logging.getLogger(__name__) - -@contextlib.contextmanager -def task(ctx, config): - """ - Execute commands on a given role - - tasks: - - ceph: - - kclient: [client.a] - - exec: - client.a: - - "echo 'module libceph +p' > /sys/kernel/debug/dynamic_debug/control" - - "echo 'module ceph +p' > /sys/kernel/debug/dynamic_debug/control" - - interactive: - - It stops and fails with the first command that does not return on success. It means - that if the first command fails, the second won't run at all. - - To avoid confusion it is recommended to explicitly enclose the commands in - double quotes. For instance if the command is false (without double quotes) it will - be interpreted as a boolean by the YAML parser. - - :param ctx: Context - :param config: Configuration - """ - try: - yield - finally: - log.info('Executing custom commands...') - assert isinstance(config, dict), "task exec got invalid config" - - testdir = teuthology.get_testdir(ctx) - - if 'all' in config and len(config) == 1: - a = config['all'] - roles = teuthology.all_roles(ctx.cluster) - config = dict((id_, a) for id_ in roles) - - for role, ls in config.iteritems(): - (remote,) = ctx.cluster.only(role).remotes.iterkeys() - log.info('Running commands on role %s host %s', role, remote.name) - for c in ls: - c.replace('$TESTDIR', testdir) - remote.run( - args=[ - 'sudo', - 'TESTDIR={tdir}'.format(tdir=testdir), - 'bash', - '-c', - c], - ) - |