diff options
author | Christopher Harvey <chris@basementcode.com> | 2010-08-02 11:05:47 -0400 |
---|---|---|
committer | Christopher Harvey <chris@basementcode.com> | 2010-08-02 11:05:47 -0400 |
commit | cbcbc8f0907cb950942ba750ed2722a62c4a0417 (patch) | |
tree | 3917834a29d778e41b9ff31f831507fc9f95660f | |
parent | Changed __rowEdited in main.py to mark a cell as invalid if the script for th... (diff) | |
download | ventoo-cbcbc8f0907cb950942ba750ed2722a62c4a0417.tar.gz ventoo-cbcbc8f0907cb950942ba750ed2722a62c4a0417.tar.bz2 ventoo-cbcbc8f0907cb950942ba750ed2722a62c4a0417.zip |
Added scripts that check fstab file systems and block devices
-rw-r--r-- | modules/fstab/getDevs.py | 14 | ||||
-rw-r--r-- | modules/fstab/main.xml | 6 | ||||
-rw-r--r-- | modules/fstab/testFStype.py | 7 |
3 files changed, 24 insertions, 3 deletions
diff --git a/modules/fstab/getDevs.py b/modules/fstab/getDevs.py new file mode 100644 index 0000000..3180d0d --- /dev/null +++ b/modules/fstab/getDevs.py @@ -0,0 +1,14 @@ +""" +This function makes sure the user enters a valid block device in /etc/fstab +""" + +import os +import re +import os.path as osp + +def validate(userIn): + pdb.set_trace() + devices = os.listdir('/dev') + if osp.split(userIn)[1] in devices: + return True + return False diff --git a/modules/fstab/main.xml b/modules/fstab/main.xml index 82328c1..2a4c711 100644 --- a/modules/fstab/main.xml +++ b/modules/fstab/main.xml @@ -1,10 +1,10 @@ <VentooModule> <root mult="*"> - <spec mult="1" docurl="specdoc.html"/> + <spec mult="1" docurl="specdoc.html" validate="getDevs.py"/> <file mult="1" docurl="fileDoc.html"/> - <vfstype mult="1" docurl="typeDoc.html"/> + <vfstype mult="1" docurl="typeDoc.html" validate="testFStype.py"/> <opt mult="*" docurl="optsDoc.html"/> <dump mult="1" docurl="dumpDoc.html"/> <passno mult="1" docurl="dumpDoc.html"/> </root> -</VentooModule>
\ No newline at end of file +</VentooModule> diff --git a/modules/fstab/testFStype.py b/modules/fstab/testFStype.py new file mode 100644 index 0000000..0ce5de3 --- /dev/null +++ b/modules/fstab/testFStype.py @@ -0,0 +1,7 @@ + + +def validate(text): + validTypes = ['ext2', 'ext3', 'reiserfs', 'swap', 'vfat', 'ntfs', 'auto'] + if text in validTypes: + return True + return False |