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)
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):
'''