]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: address PR merge comments
authorPaul Cuzner <pcuzner@redhat.com>
Sun, 16 Aug 2020 21:59:24 +0000 (09:59 +1200)
committerJan Fajerski <jfajerski@suse.com>
Thu, 27 Aug 2020 12:30:29 +0000 (14:30 +0200)
Change to use existing properties of the Device class to
determine whether the lsm data gathering should be
attempted.

Signed-off-by: Paul Cuzner <pcuzner@redhat.com>
(cherry picked from commit d59a75f484096f08191f815223608b7f2e55a1fb)

src/ceph-volume/ceph_volume/util/device.py

index 4589b82da4adaf7fb3f9d63553878384ee926292..e533e96a7ad3237678e2c4cb510260454a903e9b 100644 (file)
@@ -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):
         '''