Merge pull request #2209 from resin-io/filter-raid-devices

fix(adapters): Always ignore RAID attached devices
This commit is contained in:
Jonas Hermsmeier 2018-04-17 20:09:31 +02:00 committed by GitHub
commit 347932b213
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,6 +79,11 @@ class BlockDeviceAdapter extends EventEmitter {
this.emit('error', error)
callback && callback(error)
}).filter((drive) => {
// Always ignore RAID attached devices, as they are in danger-country;
// Even flashing RAIDs intentionally can have unintended effects
if (drive.busType === 'RAID') {
return false
}
return !drive.error && (options.includeSystemDrives || !drive.isSystem)
}).map((drive) => {
drive.displayName = drive.device