]> 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)
committerPaul Cuzner <pcuzner@redhat.com>
Sun, 16 Aug 2020 21:59:24 +0000 (09:59 +1200)
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>
src/ceph-volume/ceph_volume/util/device.py

index d3eb940f9614fa718a8dfbbe0a767b8456ba4c65..5ab2b29177330e70813b8ea887a9d11e4450ed10 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):
         '''