From: David Zafman Date: Wed, 22 Oct 2014 22:54:44 +0000 (-0700) Subject: Thrasher: Disable ceph_objectstore_tool tests if old release missing command X-Git-Tag: v0.94.10~27^2^2~250 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4ddadf06986792ccad00b15dcd17be4f96c725c4;p=ceph.git Thrasher: Disable ceph_objectstore_tool tests if old release missing command Leaving disabled until merge of import/export fixes Fixes: #9805 Signed-off-by: David Zafman --- diff --git a/tasks/ceph_manager.py b/tasks/ceph_manager.py index 33c40c77a8b..bfc28fcb877 100644 --- a/tasks/ceph_manager.py +++ b/tasks/ceph_manager.py @@ -12,6 +12,7 @@ from teuthology import misc as teuthology from tasks.scrub import Scrubber from util.rados import cmd_erasure_code_profile from teuthology.orchestra.remote import Remote +import subprocess def make_admin_daemon_dir(ctx, remote): """ @@ -57,6 +58,12 @@ def mount_osd_data(ctx, remote, osd): ] ) + +def cmd_exists(cmd): + return subprocess.call("type " + cmd, shell=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0 + + class Thrasher: """ Object used to thrash Ceph @@ -77,7 +84,10 @@ class Thrasher: self.revive_timeout += 120 self.clean_wait = self.config.get('clean_wait', 0) self.minin = self.config.get("min_in", 3) - self.ceph_objectstore_tool = self.config.get('ceph_objectstore_tool', False) + if cmd_exists("ceph_objectstore_tool"): + self.ceph_objectstore_tool = self.config.get('ceph_objectstore_tool', False) + else: + self.ceph_objectstore_tool = False self.chance_move_pg = self.config.get('chance_move_pg', 1.0) num_osds = self.in_osds + self.out_osds