From: Sage Weil Date: Fri, 29 Jan 2021 16:40:44 +0000 (-0600) Subject: mgr/devicehealth: make CLI commands error when pool doesn't exist X-Git-Tag: v17.1.0~3120^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db31d09efa60fad98429b1ec7e0d30188f355035;p=ceph.git mgr/devicehealth: make CLI commands error when pool doesn't exist This is better than silently failing to do anything. Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/devicehealth/module.py b/src/pybind/mgr/devicehealth/module.py index 36cb182f4f19..c1c04896c01d 100644 --- a/src/pybind/mgr/devicehealth/module.py +++ b/src/pybind/mgr/devicehealth/module.py @@ -330,7 +330,7 @@ class Module(MgrModule): def scrape_daemon(self, daemon_type: str, daemon_id: str) -> Tuple[int, str, str]: ioctx = self.open_connection() if not ioctx: - return 0, "", "" + return -errno.EAGAIN, "", "device_health_metrics pool not yet available" raw_smart_data = self.do_scrape_daemon(daemon_type, daemon_id) if raw_smart_data: for device, raw_data in raw_smart_data.items(): @@ -345,7 +345,7 @@ class Module(MgrModule): assert osdmap is not None ioctx = self.open_connection() if not ioctx: - return 0, "", "" + return -errno.EAGAIN, "", "device_health_metrics pool not yet available" did_device = {} ids = [] for osd in osdmap['osds']: @@ -379,7 +379,7 @@ class Module(MgrModule): (daemon_type, daemon_id) = daemons[0].split('.') ioctx = self.open_connection() if not ioctx: - return 0, "", "" + return -errno.EAGAIN, "", "device_health_metrics pool not yet available" raw_smart_data = self.do_scrape_daemon(daemon_type, daemon_id, devid=devid) if raw_smart_data: