Merge pull request #19948 from tchaikov/wip-standby-module-get-config

pybind/mgr/mgr_module: add default param for MgrStandbyModule.get_con…

Reviewed-by: John Spray <john.spray@redhat.com>
This commit is contained in:
John Spray 2018-01-22 10:53:49 +00:00 committed by GitHub
commit 67abd1248b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,8 +177,20 @@ class MgrStandbyModule(ceph_module.BaseMgrStandbyModule):
def get_mgr_id(self):
return self._ceph_get_mgr_id()
def get_config(self, key):
return self._ceph_get_config(key)
def get_config(self, key, default=None):
"""
Retrieve the value of a persistent configuration setting
:param str key:
:param default: the default value of the config if it is not found
:return: str
"""
r = self._ceph_get_config(key)
if r is None:
return default
else:
return r
def get_active_uri(self):
return self._ceph_get_active_uri()
@ -624,4 +636,3 @@ class MgrModule(ceph_module.BaseMgrModule):
self._rados.connect()
return self._rados