diskLayout() fix parsing linux (JSON)

This commit is contained in:
Sebastian Hildebrandt
2022-06-13 14:40:44 +02:00
parent ef55058b0c
commit bc4b737e41
4 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -852,7 +852,7 @@ function diskLayout(callback) {
try {
const outJSON = JSON.parse(out);
if (outJSON && {}.hasOwnProperty.call(outJSON, 'blockdevices')) {
devices = outJSON.blockdevices.filter(item => { return (item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fstype === null && item.parttype === null)); });
devices = outJSON.blockdevices.filter(item => { return (item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fsType === null && item.parttype === null && item.name.indexOf('ram') !== 0)); });
}
} catch (e) {
// fallback to older version of lsblk