mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Apply suggestions from code review
This commit is contained in:
parent
75ab54ee14
commit
6f908e9ccf
1 changed files with 2 additions and 3 deletions
|
@ -518,8 +518,7 @@ def app_upgrade(app=[], url=None, file=None, force=False):
|
||||||
|
|
||||||
apps = app
|
apps = app
|
||||||
# Check if disk space available
|
# Check if disk space available
|
||||||
size = os.statvfs('/')
|
if free_space_in_directory("/") <= 512 * 1000 * 1000:
|
||||||
if (size.f_bavail * size.f_frsize) / 1024 <= 512000:
|
|
||||||
raise YunohostValidationError("disk_space_not_sufficient_update")
|
raise YunohostValidationError("disk_space_not_sufficient_update")
|
||||||
# If no app is specified, upgrade all apps
|
# If no app is specified, upgrade all apps
|
||||||
if not apps:
|
if not apps:
|
||||||
|
@ -882,7 +881,7 @@ def app_install(
|
||||||
|
|
||||||
# Check if disk space available
|
# Check if disk space available
|
||||||
size = os.statvfs('/')
|
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")
|
raise YunohostValidationError("disk_space_not_sufficient_install")
|
||||||
|
|
||||||
# Check ID
|
# Check ID
|
||||||
|
|
Loading…
Add table
Reference in a new issue