]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa: get config only on running MDS
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 20 Sep 2017 22:44:40 +0000 (15:44 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 20 Sep 2017 22:47:28 +0000 (15:47 -0700)
Fixes: http://tracker.ceph.com/issues/21466
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
qa/tasks/cephfs/filesystem.py

index 3d06c0d6d120cdbe52daef1970e6550d9a78bf0e..44f6cbaf16dbf0e9e9e2418dfed9f5dd9ca4acbd 100644 (file)
@@ -8,6 +8,7 @@ import time
 import datetime
 import re
 import errno
+import random
 
 from teuthology.exceptions import CommandFailedError
 from teuthology import misc
@@ -225,6 +226,17 @@ class MDSCluster(CephCluster):
         else:
             cb(mds_id)
 
+    def get_config(self, key, service_type=None):
+        """
+        get_config specialization of service_type="mds"
+        """
+        if service_type != "mds":
+            return super(MDSCluster, self).get_config(key, service_type)
+
+        # Some tests stop MDS daemons, don't send commands to a dead one:
+        service_id = random.sample(filter(lambda i: self.mds_daemons[i].running(), self.mds_daemons), 1)[0]
+        return self.json_asok(['config', 'get', key], service_type, service_id)[key]
+
     def mds_stop(self, mds_id=None):
         """
         Stop the MDS daemon process(se).  If it held a rank, that rank