From 4d331dd200f590045222cfaf193a79ef5f513dc3 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 15 Jun 2018 09:52:30 +1200 Subject: [PATCH] filter out disks with the ID_CDROM udev property --- subiquity/models/filesystem.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/subiquity/models/filesystem.py b/subiquity/models/filesystem.py index 727631e3..6852a6d5 100644 --- a/subiquity/models/filesystem.py +++ b/subiquity/models/filesystem.py @@ -345,12 +345,16 @@ class FilesystemModel(object): if path in currently_mounted: continue if data['DEVTYPE'] == 'disk': - if not data["DEVPATH"].startswith('/devices/virtual'): - if data["MAJOR"] != "2" and data['attrs'].get('ro') != "1": - # log.debug('disk={}\n{}'.format( - # path, json.dumps(data, indent=4, sort_keys=True))) - info = self.prober.get_storage_info(path) - self._available_disks[path] = Disk.from_info(info) + if data["DEVPATH"].startswith('/devices/virtual'): + continue + if data["MAJOR"] == "2" or data['attrs'].get('ro') == "1": + continue + if data.get("ID_CDROM", ""): + continue + # log.debug('disk={}\n{}'.format( + # path, json.dumps(data, indent=4, sort_keys=True))) + info = self.prober.get_storage_info(path) + self._available_disks[path] = Disk.from_info(info) def _use_disk(self, disk): if disk.path not in self._disks: