From e6a436bb2707dfbb275e52a73a59fc2dd05c2c3a Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 17 Apr 2017 12:36:31 +0800 Subject: [PATCH] qa/tasks/ceph_manager: be able to store options with service type so we are able to change options for services other than mon while thrashing. Signed-off-by: Kefu Chai --- qa/tasks/ceph_manager.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index 8ff2556a7a0..fd5601989c1 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -141,13 +141,17 @@ class Thrasher: self.config = dict() # prevent monitor from auto-marking things out while thrasher runs # try both old and new tell syntax, in case we are testing old code - self.saved_options = {} + self.saved_options = [] + # assuming that the default settings do not vary from one daemon to + # another first_mon = teuthology.get_first_mon(manager.ctx, self.config).split('.') - opt_name = 'mon_osd_down_out_interval' - self.saved_options[opt_name] = manager.get_config(first_mon[0], - first_mon[1], - opt_name) - self._set_config('mon', '*', opt_name, 0) + opts = [('mon', 'mon_osd_down_out_interval', 0)] + for service, opt, new_value in opts: + old_value = manager.get_config(first_mon[0], + first_mon[1], + opt) + self.saved_options.append((service, opt, old_value)) + self._set_config(service, '*', opt, new_value) # initialize ceph_objectstore_tool property - must be done before # do_thrash is spawned - http://tracker.ceph.com/issues/18799 if (self.config.get('powercycle') or @@ -961,9 +965,9 @@ class Thrasher: if self.ceph_manager.get_pool_pg_num(pool) > 0: self.fix_pgp_num(pool) self.pools_to_fix_pgp_num.clear() - for opt, value in self.saved_options.iteritems(): - self._set_config('mon', '*', opt, value) - self.saved_options.clear() + for service, opt, saved_value in self.saved_options: + self._set_config(service, '*', opt, saved_value) + self.saved_options = [] self.all_up() -- 2.39.5