]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: CephManager: add get_config() method
authorKefu Chai <kchai@redhat.com>
Sun, 12 Feb 2017 06:12:25 +0000 (14:12 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 13 Feb 2017 01:25:50 +0000 (09:25 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/ceph_manager.py

index f4d9d509f066afbdcfc196b0a872f97c6c54c4c4..f896a81b96d935d4ba97ad5e255b9f9891de1a92 100644 (file)
@@ -1246,7 +1246,7 @@ class CephManager:
             proc = self.admin_socket(service_type, service_id,
                                      args, check_status=False, stdout=stdout)
             if proc.exitstatus is 0:
-                break
+                return proc
             else:
                 tries += 1
                 if (tries * 5) > timeout:
@@ -1270,6 +1270,16 @@ class CephManager:
                 return i
         assert False
 
+    def get_config(self, service_type, service_id, name):
+        """
+        :param node: like 'mon.a'
+        :param name: the option name
+        """
+        proc = self.wait_run_admin_socket(service_type, service_id,
+                                          ['config', 'show'])
+        j = json.loads(proc.stdout.getvalue())
+        return j[name]
+
     def set_config(self, osdnum, **argdict):
         """
         :param osdnum: osd number