summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2017-08-29 11:40:43 +0100
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2017-08-29 11:41:09 +0100
commit3b9d7030a6de3ced7725e292365a5c8fd86f8d65 (patch)
treee3d2a7daf5bb2cce694a6becd107bc196edf2978
parente4fe92a3f40db8b7529d0dae5d4d4902b262d77a (diff)
downloadybd-ps-kbas-cull-v2.tar.gz
Use 'gigabytes' instead of magic numberps-kbas-cull-v2
-rw-r--r--ybd/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ybd/utils.py b/ybd/utils.py
index d5b5311..2f878b3 100644
--- a/ybd/utils.py
+++ b/ybd/utils.py
@@ -452,8 +452,9 @@ def cull_directory(artifact_dir, target_space):
def get_free(directory):
# calculate free space in GB
+ gigabytes = 1073741824
stat = os.statvfs(directory)
- return stat.f_frsize * stat.f_bavail / 1073741824
+ return stat.f_frsize * stat.f_bavail / gigabytes
@contextlib.contextmanager