Get nvme devices inside /sys/block/ instead of /dev

This commit is contained in:
Swapnil 2024-07-01 18:15:14 +05:30
parent 2c19f2eefc
commit 75744e0010
Signed by: swapnil
GPG Key ID: 58029C48BB100574

View File

@ -157,7 +157,7 @@ class ServerData:
return devices
# Get the list of nvme devices starting with 'nvme'
nvme_devices = [device for device in os.listdir('/dev') if device.startswith('nvme')]
nvme_devices = [device for device in os.listdir('/sys/block') if device.startswith('nvme')]
for device in nvme_devices:
device_path = '/dev/' + device