From: Kefu Chai Date: Mon, 17 Apr 2017 04:36:31 +0000 (+0800) Subject: qa/tasks/ceph_manager: be able to store options with service type X-Git-Tag: v12.0.3~306^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e6a436bb2707dfbb275e52a73a59fc2dd05c2c3a;p=ceph-ci.git 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 --- 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()