From: John Spray Date: Mon, 2 Jul 2018 13:23:10 +0000 (+0100) Subject: mgr: improve docs on methods that can return None X-Git-Tag: v14.0.1~795^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0763e9be30e81dcc0710abf2ec4941b855dd6e3c;p=ceph.git mgr: improve docs on methods that can return None Signed-off-by: John Spray --- diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index 82480385f1b9..c6ac24ce52d9 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -453,10 +453,14 @@ class MgrModule(ceph_module.BaseMgrModule): """ Fetch the daemon metadata for a particular service. + ceph-mgr fetches metadata asynchronously, so are windows of time during + addition/removal of services where the metadata is not available to + modules. ``None`` is returned if no metadata is available. + :param str svc_type: service type (e.g., 'mds', 'osd', 'mon') :param str svc_id: service id. convert OSD integer IDs to strings when calling this - :rtype: dict + :rtype: dict, or None if no metadata found """ return self._ceph_get_metadata(svc_type, svc_id) @@ -464,9 +468,12 @@ class MgrModule(ceph_module.BaseMgrModule): """ Fetch the latest status for a particular service daemon. + This method may return ``None`` if no status information is + available, for example because the daemon hasn't fully started yet. + :param svc_type: string (e.g., 'rgw') :param svc_id: string - :return: dict + :return: dict, or None if the service is not found """ return self._ceph_get_daemon_status(svc_type, svc_id)