From 4ddadf06986792ccad00b15dcd17be4f96c725c4 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Wed, 22 Oct 2014 15:54:44 -0700 Subject: [PATCH] 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 --- tasks/ceph_manager.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tasks/ceph_manager.py b/tasks/ceph_manager.py index 33c40c77a8b91..bfc28fcb87716 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 -- 2.39.5