Fix storage size

Disk attributes are in sector size, so scale by 512.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
This commit is contained in:
Ryan Harper 2015-06-25 21:54:03 -05:00
parent 6b82c1fc7e
commit 8902942fc0
1 changed files with 2 additions and 1 deletions

View File

@ -60,4 +60,5 @@ class FilesystemModel(models.Model):
return "%.3f %s" % (size / math.pow(1024, p), units[int(p)]) return "%.3f %s" % (size / math.pow(1024, p), units[int(p)])
def get_disk_size(self, disk): def get_disk_size(self, disk):
return self._humanize_size(int(self.storage[disk]['attrs']['size'])) return self._humanize_size(
int(self.storage[disk]['attrs']['size']) * 512)