finally fixed the size properly
This commit is contained in:
parent
9bf82f30dc
commit
9f23dbddfd
1 changed files with 2 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue