From 6f908e9ccf77df44e0e3d85555c35693ff0478c4 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 8 Aug 2021 19:00:03 +0200 Subject: [PATCH] Apply suggestions from code review --- src/yunohost/app.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index b3fea9a32..3b611e9d3 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -518,8 +518,7 @@ def app_upgrade(app=[], url=None, file=None, force=False): apps = app # Check if disk space available - size = os.statvfs('/') - if (size.f_bavail * size.f_frsize) / 1024 <= 512000: + if free_space_in_directory("/") <= 512 * 1000 * 1000: raise YunohostValidationError("disk_space_not_sufficient_update") # If no app is specified, upgrade all apps if not apps: @@ -882,7 +881,7 @@ def app_install( # Check if disk space available size = os.statvfs('/') - if (size.f_bavail * size.f_frsize) / 1024 <= 512000: + if free_space_in_directory("/") <= 512 * 1000 * 1000: raise YunohostValidationError("disk_space_not_sufficient_install") # Check ID