Merge pull request #365 from mwhudson/lp-1769478
filter out disks with the ID_CDROM udev property
This commit is contained in:
commit
ad9d08776a
|
@ -345,12 +345,18 @@ class FilesystemModel(object):
|
||||||
if path in currently_mounted:
|
if path in currently_mounted:
|
||||||
continue
|
continue
|
||||||
if data['DEVTYPE'] == 'disk':
|
if data['DEVTYPE'] == 'disk':
|
||||||
if not data["DEVPATH"].startswith('/devices/virtual'):
|
if data["DEVPATH"].startswith('/devices/virtual'):
|
||||||
if data["MAJOR"] != "2" and data['attrs'].get('ro') != "1":
|
continue
|
||||||
# log.debug('disk={}\n{}'.format(
|
if data["MAJOR"] in ("2", "11"): # serial and cd devices
|
||||||
# path, json.dumps(data, indent=4, sort_keys=True)))
|
continue
|
||||||
info = self.prober.get_storage_info(path)
|
if data['attrs'].get('ro') == "1":
|
||||||
self._available_disks[path] = Disk.from_info(info)
|
continue
|
||||||
|
if "ID_CDROM" in data:
|
||||||
|
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):
|
def _use_disk(self, disk):
|
||||||
if disk.path not in self._disks:
|
if disk.path not in self._disks:
|
||||||
|
|
Loading…
Reference in New Issue