* excluded ram block devices from the "valid" list of devices (Closes: #196)

This commit is contained in:
lars 2009-06-13 02:23:35 +00:00
parent b7f6afcc67
commit b5c4eabc26
1 changed files with 5 additions and 0 deletions

View File

@ -46,8 +46,10 @@ LOGGER = logging.getLogger("CryptoNAS")
DEFAULT_SYSBLOCK_DIR = '/sys/block'
DEFAULT_DEVNODE_DIR = '/dev'
MINIMUM_STORAGE_SIZE = 10
# defined device numbers: http://www.lanana.org/docs/device-list/devices.txt
MAJOR_DEVNUM_LOOP = 7
MAJOR_DEVNUM_FLOPPY = 2
MAJOR_DEVNUM_RAMDISK = 1
MAJOR_DEVNUM_MD_RAID = 9
## cache settings
@ -233,6 +235,9 @@ class Blockdevice:
## otherwise we would have a long timeout, while reading the devices
if (self.major == MAJOR_DEVNUM_FLOPPY):
return False
# we don't want to store data in ramdisks (e.g. /dev/ram0)
if (self.major == MAJOR_DEVNUM_RAMDISK):
return False
except TypeError:
return False
return True