From fbd43c8b0d44dbf304aa7df9174511ba7013e06c Mon Sep 17 00:00:00 2001 From: Mike Fulbright Date: Mon, 16 Dec 2002 21:11:37 +0000 Subject: filter out USB and IEEE1394 storage devices as removable too --- isys/isys.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'isys/isys.py') diff --git a/isys/isys.py b/isys/isys.py index 597e31f3d..167e18564 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -434,6 +434,27 @@ def driveIsRemovable(device): else: makeDevInode(device, "/tmp/disk") rc = (_isys.isScsiRemovable("/tmp/disk") == 1) + + # need to test if its USB or IEEE1394 even if it doesnt look removable + if not rc: + if os.access("/tmp/scsidisks", os.R_OK): + sdlist=open("/tmp/scsidisks", "r") + sdlines = sdlist.readlines() + sdlist.close() + for l in sdlines: + try: + # each line has format of: + (sddev, sdmod) = string.split(l) + + if sddev == device: + if sdmod in ['sbp2', 'usb-storage']: + rc = 1 + else: + rc = 0 + break + except: + pass + os.unlink("/tmp/disk") return rc -- cgit