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
|
default = 0
|
||||||
try:
|
try:
|
||||||
size_blocks = int(file(os.path.join(self.devdir, 'size')).read())
|
size_blocks = int(file(os.path.join(self.devdir, 'size')).read())
|
||||||
## size is defined as the number of blocks (512 byte)
|
## size is defined as the number of blocks (512 byte each)
|
||||||
return int(size_blocks/512)
|
return int(size_blocks*512/1024/1024)
|
||||||
except OSError:
|
except OSError:
|
||||||
return default
|
return default
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
Loading…
Reference in a new issue