finally fixed the size properly

This commit is contained in:
lars 2008-01-14 22:11:03 +00:00
parent 9bf82f30dc
commit 9f23dbddfd

View file

@ -389,8 +389,8 @@ class Blockdevice:
default = 0
try:
size_blocks = int(file(os.path.join(self.devdir, 'size')).read())
## size is defined as the number of blocks (512 byte)
return int(size_blocks/512)
## size is defined as the number of blocks (512 byte each)
return int(size_blocks*512/1024/1024)
except OSError:
return default
except ValueError: