This will not work because
/etc/fstab file doesn't conform to the format the ConfigParser supports.
man 5 fstab indicates, the
/etc/fstab file is a whitespace separated file with 6 columns. The Python ConfigParser is a library for Parsing files commonly known as
.ini files that, simplified, consist of sections that contain key/value pairs:
key1 = value1
key2 = value2
key3 = value3
fstab file yourself is relatively easy. Just copy all the comment lines (those with first non-whitespace character '#') and split the other lines using
.split() to the 6 fields. I use that to rearrange my
fstab file to be only 79 columns.