コード例 #1
0
ファイル: btrfs.py プロジェクト: zstackorg/zstack-utility
    def _get_disk_capacity(self):
        total = linux.get_total_disk_size(self.root)

        out = shell.call('df')
        avail = None
        for l in out.split('\n'):
            if self.root in l:
                _, _, _, avail, _, _ = l.split()

        if not avail:
            raise Exception('cannot find available capacity, "df" output":\n %s' % out)

        return total, long(avail) * 1024
コード例 #2
0
 def get_capacity(self):
     total = linux.get_total_disk_size(self.storage_path)
     used = linux.get_used_disk_size(self.storage_path)
     return (total, total - used)
コード例 #3
0
 def _get_disk_capacity(self):
     total = linux.get_total_disk_size(self.mount_path)
     used = linux.get_used_disk_apparent_size(self.mount_path)
     return total, total-used