Fix type filesystem get.

At first detect filesystem by parted, after detect by blkid.
netsetup
Mike Hiretsky 13 years ago
parent 061c6dac3f
commit 12b71d86ce

@ -248,7 +248,7 @@ class fillVars(object, glob_attr):
# parse all parted lines started with Disk and started with number # parse all parted lines started with Disk and started with number
floppyData = self.removeFloppy() floppyData = self.removeFloppy()
execProg = self.getProgPath("/usr/sbin/parted") execProg = self.getProgPath("/usr/sbin/parted")
execStr = '%s -l'%execProg execStr = '%s -lm'%execProg
if not execProg: if not execProg:
cl_overriding.printERROR(_("Command not found '%s'")%"parted") cl_overriding.printERROR(_("Command not found '%s'")%"parted")
cl_overriding.exit(1) cl_overriding.exit(1)
@ -258,14 +258,14 @@ class fillVars(object, glob_attr):
if res is False: if res is False:
cl_overriding.printERROR(_("Cann't execute '%s'")%execStr) cl_overriding.printERROR(_("Cann't execute '%s'")%execStr)
cl_overriding.exit(1) cl_overriding.exit(1)
partedLines = filter(lambda x: x.startswith("Disk") or partedLines = filter(lambda x: x.startswith("/dev/") or
x.strip()[:1].isdigit(), res ) x.strip()[:1].isdigit(), res )
for line in partedLines: for line in partedLines:
# split data # split data
parts = filter(lambda x: x, line.strip().split(' ')) parts = filter(lambda x: x, line.strip().split(':'))
# if start device description # if start device description
if parts[0] == "Disk": if parts[0].startswith('/dev/'):
curDevice = parts[1][:-1] curDevice = parts[0]
continue continue
# if first part is number then it is partition description # if first part is number then it is partition description
if parts[0].isdigit(): if parts[0].isdigit():
@ -279,6 +279,7 @@ class fillVars(object, glob_attr):
else: else:
disk_hash[partition]['part'] = parts[4] disk_hash[partition]['part'] = parts[4]
disk_hash[partition]['size'] = parts[3] disk_hash[partition]['size'] = parts[3]
disk_hash[partition]['format'] = parts[4]
# fill format, name and uuid # fill format, name and uuid
execStr = self.getProgPath('/sbin/blkid') execStr = self.getProgPath('/sbin/blkid')
if not execStr: if not execStr:

Loading…
Cancel
Save