modified: ri_data.py

modified:   ri_tk_cmd.py
  The size of from os that must be value.
This commit is contained in:
fling
2010-10-13 19:31:19 +08:00
parent dfd55b58e9
commit dd9762c629
2 changed files with 24 additions and 21 deletions

View File

@@ -31,7 +31,7 @@ def mount_list_init():
sz = ri_data.Partition.get_size(m.device)
if not sz:
sz = ri_data.Raid.get_size(m.device)
s = m.device.ljust(10) + m.directory.ljust(10) + m.filesystem.ljust(10) + m.format.ljust(4) + sz.ljust(6)
s = m.device.ljust(10) + m.directory.ljust(10) + m.filesystem.ljust(10) + m.format.ljust(4) + sz.ljust(6)+ri_data.Partition.unit
l.append(s)
display.var_dict['mount.list'].set(value=tuple([str(i) for i in l]))
@@ -85,7 +85,7 @@ def mp_top_ok():
fs = eval(display.var_dict['mp_top_fs'].get())[idx2]
elif fm=='no':
fs = base_fs
s2 = dev.ljust(10) + dir.ljust(10) + fs.ljust(10) + fm.ljust(4) + sz.ljust(6)
s2 = dev.ljust(10) + dir.ljust(10) + fs.ljust(10) + fm.ljust(4) + sz.ljust(6)+ri_data.Partition.unit
l.append(s2)
# make change in internal data structure
ri_data.MountPoint.change(dev2, dir, fs, fm)
@@ -272,7 +272,7 @@ def raid_raw_init():
dev_in_raid.update(r.spare_components)
raw_devs = [ p.device for p in ri_data.Partition.list
if p.flags=='yes' and p.device not in dev_in_raid ]
if p.israid=='yes' and p.device not in dev_in_raid ]
display.var_dict['raid_raw_devs'].set(value=tuple(raw_devs))
def list_to_list(list_from, var_from, var_to):
@@ -327,12 +327,12 @@ devs - raid component devices
sz = float(p.size[:-len(unit)])
if level == '0':
sz=sz*len(devs)
return "%d%s"%(sz,unit)
return str(sz)
elif level == '1':
return "%d%s"%(sz,unit)
return str(sz)
elif level == '5':
sz=sz*(len(devs)-1)
return "%d%s"%(sz,unit)
return str(sz)
def raid_device_add():
''' add a new raid device '''