From: Paul Cuzner Date: Sun, 16 Aug 2020 21:59:24 +0000 (+1200) Subject: ceph-volume: address PR merge comments X-Git-Tag: v15.2.9~122^2~116^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=45fe98e9dcfbf83864aababe8646e8dfc89c39f3;p=ceph.git ceph-volume: address PR merge comments Change to use existing properties of the Device class to determine whether the lsm data gathering should be attempted. Signed-off-by: Paul Cuzner (cherry picked from commit d59a75f484096f08191f815223608b7f2e55a1fb) --- diff --git a/src/ceph-volume/ceph_volume/util/device.py b/src/ceph-volume/ceph_volume/util/device.py index 4589b82da4ad..e533e96a7ad3 100644 --- a/src/ceph-volume/ceph_volume/util/device.py +++ b/src/ceph-volume/ceph_volume/util/device.py @@ -110,17 +110,12 @@ class Device(object): json returned will provide LSM attributes, and any associated errors that lsm encountered when probing the device. ''' - devName = self.path.split('/')[-1] - if not os.path.exists('/sys/block/{}'.format(devName)): + if not self.exists or not self.is_device: return {} lsm_disk = LSMDisk(self.path) - if not lsm_disk.lsm_available: - return {} - - lsm_json = lsm_disk.json_report() - return lsm_json + return lsm_disk.json_report() def __lt__(self, other): '''