Fix get options from fstab.

netsetup
Mike Hiretsky 14 years ago
parent b63467ca06
commit 152398957a

@ -272,18 +272,19 @@ class fillVars(object, glob_attr):
# split all string by columns and discard string which has less that 4
# columns
mountOptionsList = \
map(lambda x:[mapUuidDev.get(x[0],x[0])]+x[1:4],
filter(lambda x: len(x)>=4,
map(lambda x: filter(lambda x: x ,
x.replace('\t',' ').split(' ')),
mountOptionsList))
map(lambda x: filter(lambda x: x ,
x.replace('\t',' ').split(' ')),
mountOptionsList)))
# get dev which has ntfs filesystem
mountFormatList = \
filter(lambda x: mapUuidDev.get(x[0],x[0]) in disk_hash.keys() \
filter(lambda x: x[0] in disk_hash.keys() \
and x[1] in ("ntfs","ntfs-3g"),
map(lambda y: (y[0],y[2]), mountOptionsList))
# split options and discard rw opt
mountOptionsList = \
filter(lambda x: mapUuidDev.get(x[0],x[0]) in disk_hash.keys(),
filter(lambda x: x[0] in disk_hash.keys(),
map(lambda y: (y[0],filter(lambda z: z!="rw",
y[3].split(','))),
mountOptionsList))
@ -291,12 +292,11 @@ class fillVars(object, glob_attr):
dictOptionList = dict(mountOptionsList)
dictFormatList = dict(mountFormatList)
for dev in disk_hash.keys():
iddev = mapDevUuid.get(dev,dev)
if iddev in dictOptionList:
disk_hash[dev]['options'] = ",".join(dictOptionList[iddev])
if iddev in dictFormatList and "format" in disk_hash[dev] and \
if dev in dictOptionList:
disk_hash[dev]['options'] = ",".join(dictOptionList[dev])
if dev in dictFormatList and "format" in disk_hash[dev] and \
disk_hash[dev]['format'] in ("ntfs","ntfs-3g"):
disk_hash[dev]['format'] = dictFormatList[iddev]
disk_hash[dev]['format'] = dictFormatList[dev]
return disk_hash
def separateDevice(self,device):

Loading…
Cancel
Save