summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbst-marge-bot <marge-bot@buildstream.build>2019-06-12 15:14:25 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-06-12 15:14:25 +0000
commit16a7683365404e93ffc11c87f8d80e9f1651ccb8 (patch)
tree44e02fd5e4b3ba1db29cbdce804ae5d0df51569b
parent64750a1f74e9fb6cb01d6ffbe5ca3aab1cddbaaf (diff)
parent91178bdf105db358a025ce36de1231f76875f3be (diff)
downloadbuildstream-16a7683365404e93ffc11c87f8d80e9f1651ccb8.tar.gz
Merge branch 'aevri/psutil_volume' into 'master'
utils._get_volume_size: use shutil.disk_usage See merge request BuildStream/buildstream!1393
-rw-r--r--src/buildstream/utils.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/buildstream/utils.py b/src/buildstream/utils.py
index f509ce998..775a11142 100644
--- a/src/buildstream/utils.py
+++ b/src/buildstream/utils.py
@@ -642,12 +642,11 @@ def _get_dir_size(path):
#
def _get_volume_size(path):
try:
- stat_ = os.statvfs(path)
+ usage = shutil.disk_usage(path)
except OSError as e:
raise UtilError("Failed to retrieve stats on volume for path '{}': {}"
.format(path, e)) from e
-
- return stat_.f_bsize * stat_.f_blocks, stat_.f_bsize * stat_.f_bavail
+ return usage.total, usage.free
# _parse_size():