From: Sebastian Wagner Date: Wed, 17 Jun 2020 12:39:59 +0000 (+0200) Subject: mgr/tests: _ceph_get_module_option returns proper type now. X-Git-Tag: wip-pdonnell-testing-20200918.022351~822^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=acdd26ab4e30ff5abee1d555c5e45787e3d4f02f;p=ceph-ci.git mgr/tests: _ceph_get_module_option returns proper type now. Signed-off-by: Sebastian Wagner --- diff --git a/src/pybind/mgr/tests/__init__.py b/src/pybind/mgr/tests/__init__.py index 7bccfc79970..8c54c79e526 100644 --- a/src/pybind/mgr/tests/__init__.py +++ b/src/pybind/mgr/tests/__init__.py @@ -36,7 +36,17 @@ if 'UNITTEST' in os.environ: } def _ceph_get_module_option(self, module, key, localized_prefix: None): - return self._ceph_get_store(f'{module}/{key}') + val = self._ceph_get_store(f'{module}/{key}') + mo = [o for o in self.MODULE_OPTIONS if o['name'] == key] + if len(mo) == 1 and val is not None: + cls = { + 'str': str, + 'secs': int, + 'bool': lambda s: bool(s) and s != 'false' and s != 'False', + 'int': int, + }[mo[0].get('type', 'str')] + return cls(val) + return val def _ceph_set_module_option(self, module, key, val): return self._ceph_set_store(f'{module}/{key}', val)