From: Yaarit Hatuka Date: Thu, 20 Aug 2020 18:21:11 +0000 (+0000) Subject: mgr/devicehealth: fix daemon filtering before scraping device X-Git-Tag: v14.2.12~117^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F36741%2Fhead;p=ceph.git mgr/devicehealth: fix daemon filtering before scraping device Scraping health metrics of mon devices was introduced in Nautilus, then disabled (only in Nautilus) since the 'tell' mechanism of mons was not reliable. This commit fixes a bug when filtering the daemons on the device to be scrapped (and allows scraping osd devices solely). When: $ ceph device scrape-health-metrics seagate_123 Error EAGAIN: device seagate_123 not claimed by any active OSD daemons But: $ ceph device ls DEVICE HOST:DEV DAEMONS LIFE EXPECTANCY seagate_123 hostname:sdc osd.1 See: Introducing the feature in Nautilus: PR: https://github.com/ceph/ceph/pull/24151 commit: 8d786003a44313c85c038cbdc9bd9875da197ab1 Disabling the feature in Nautilus: PR: https://github.com/ceph/ceph/pull/31446 commit: d592e56e74d94c6a05b9240fcb0031868acefbab This issue exists only in Nautilus and does not require fixes in any other branch. Fixes: https://tracker.ceph.com/issues/46871 Signed-off-by: Yaarit Hatuka --- diff --git a/src/pybind/mgr/devicehealth/module.py b/src/pybind/mgr/devicehealth/module.py index 53826d094de2..9bddc66f5f33 100644 --- a/src/pybind/mgr/devicehealth/module.py +++ b/src/pybind/mgr/devicehealth/module.py @@ -351,7 +351,7 @@ class Module(MgrModule): r = self.get("device " + devid) if not r or 'device' not in r.keys(): return -errno.ENOENT, '', 'device ' + devid + ' not found' - daemons = [d for d in r['device'].get('daemons', []) if not d.startswith('osd.')] + daemons = [d for d in r['device'].get('daemons', []) if d.startswith('osd.')] if not daemons: return (-errno.EAGAIN, '', 'device ' + devid + ' not claimed by any active OSD daemons')