diskLayout() optimized detection linux

This commit is contained in:
Sebastian Hildebrandt
2020-03-11 21:26:15 +01:00
parent cd972d01cd
commit 055b673267
4 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -747,7 +747,7 @@ function diskLayout(callback) {
try {
const outJSON = JSON.parse(out);
if (outJSON && {}.hasOwnProperty.call(outJSON, 'blockdevices')) {
devices = outJSON.blockdevices.filter(item => { return (item.group === 'disk' || item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fstype === null)); });
devices = outJSON.blockdevices.filter(item => { return (item.group === 'disk' || item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fstype === null && item.parttype === null)); });
}
} catch (e) {
// fallback to older version of lsblk