]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/tasks/ceph_manager: be able to store options with service type
authorKefu Chai <kchai@redhat.com>
Mon, 17 Apr 2017 04:36:31 +0000 (12:36 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 20 Apr 2017 06:18:21 +0000 (14:18 +0800)
so we are able to change options for services other than mon while
thrashing.

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/ceph_manager.py

index 8ff2556a7a0e9334c296c44f25b75063690dd049..fd5601989c12c496d6f9174f5832af2e9ada31c6 100644 (file)
@@ -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()