From f9609c4688f03cec462312f1f3b300013125464e Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 15 Dec 2014 11:12:34 +0000 Subject: [PATCH] tasks/cephfs: let get_config use non-mon services Previously was always using the default values of things so querying mon instead of the appropriate service worked fine. However, for things we might want to update on a per-test basis we need to go ask the correct service what the setting really is. Needed for osd_mon_report_interval_max in the ENOSPC testing. Signed-off-by: John Spray --- tasks/cephfs/filesystem.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tasks/cephfs/filesystem.py b/tasks/cephfs/filesystem.py index 837772e64a0d2..0010daa5d34f0 100644 --- a/tasks/cephfs/filesystem.py +++ b/tasks/cephfs/filesystem.py @@ -59,13 +59,15 @@ class Filesystem(object): return list(result) - def get_config(self, key): + def get_config(self, key, service_type=None): """ - Use the mon instead of the MDS asok, so that MDS doesn't have to be running - for us to query config. + Get config from mon by default, or a specific service if caller asks for it """ - service_name, service_id = misc.get_first_mon(self._ctx, self._config).split(".") - return self.json_asok(['config', 'get', key], service_name, service_id)[key] + if service_type is None: + service_type = 'mon' + + service_id = sorted(misc.all_roles_of_type(self._ctx.cluster, service_type))[0] + return self.json_asok(['config', 'get', key], service_type, service_id)[key] def set_ceph_conf(self, subsys, key, value): if subsys not in self._ctx.ceph.conf: -- 2.39.5