mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
upgrades: Only check free space bytes before dist upgrade
Remove the percentage check, which was incorrectly checking used percent, not free percent. Closes: #2046. Tests: - Fill up disk space so that 4.5G is free. Dist upgrade does not start due to not enough free space. - Fill up disk space so that 5.5G is free. Dist upgrade can be started. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
2 files changed
+6
-8
No files matched your search
+3
-4
@@ -366,10 +366,9 @@ def _check_dist_upgrade(test_upgrade=False):
|
||||
if check_dist == 'testing' and not test_upgrade:
|
||||
return (False, 'test-not-set')
|
||||
|
||||
output = subprocess.check_output(['df', '--output=avail,pcent', '/'])
|
||||
output = output.decode().split('\n')[1].split()
|
||||
free_space, free_percent = int(output[0]), int(output[1][:-1])
|
||||
if free_space < 5000000 or free_percent < 10:
|
||||
output = subprocess.check_output(['df', '--output=avail', '/'])
|
||||
free_space = int(output.decode().split('\n')[1])
|
||||
if free_space < 5000000:
|
||||
return (False, 'not-enough-free-space')
|
||||
|
||||
logging.info('Upgrading from %s to %s...', dist, codename)
|
||||
|
||||
Reference in new issue
Block a user