From: Sage Weil Date: Tue, 11 Jul 2017 20:26:16 +0000 (-0400) Subject: pybind/mgr/mgr_module: add default arg to get_config X-Git-Tag: v12.2.2~61^2~103 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c57a55e8d426e6f87d4649a799d9ddee665618e0;p=ceph.git pybind/mgr/mgr_module: add default arg to get_config Signed-off-by: Sage Weil (cherry picked from commit 39c42ddb9339c1950a3a474e8083db8b24e775a6) --- diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index 57ea33e16601b..0236e92d76c7b 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -260,14 +260,18 @@ class MgrModule(object): """ return ceph_state.get_mgr_id() - def get_config(self, key): + def get_config(self, key, default=None): """ Retrieve the value of a persistent configuration setting :param key: str :return: str """ - return ceph_state.get_config(self._handle, key) + r = ceph_state.get_config(self._handle, key) + if r is None: + return default + else: + return r def get_config_prefix(self, key_prefix): """