Fixes for Python 2.4
This commit is contained in:
parent
1a0f3b173e
commit
5ba090c366
1 changed files with 4 additions and 2 deletions
|
@ -435,9 +435,11 @@ class LinuxHardware(Hardware):
|
||||||
d['scheduler_mode'] = m.group(2)
|
d['scheduler_mode'] = m.group(2)
|
||||||
|
|
||||||
d['sectors'] = get_file_content(sysdir + "/size")
|
d['sectors'] = get_file_content(sysdir + "/size")
|
||||||
d['sectors'] = d['sectors'] if d['sectors'] else 0
|
if not d['sectors']:
|
||||||
|
d['sectors'] = 0
|
||||||
d['sectorsize'] = get_file_content(sysdir + "/queue/hw_sector_size")
|
d['sectorsize'] = get_file_content(sysdir + "/queue/hw_sector_size")
|
||||||
d['sectorsize'] = d['sectorsize'] if d['sectorsize'] else 512
|
if not d['sectorsize']:
|
||||||
|
d['sectorsize'] = 512
|
||||||
d['size'] = module.pretty_bytes(float(d['sectors']) * float(d['sectorsize']))
|
d['size'] = module.pretty_bytes(float(d['sectors']) * float(d['sectorsize']))
|
||||||
|
|
||||||
d['host'] = ""
|
d['host'] = ""
|
||||||
|
|
Loading…
Reference in a new issue