From 8c93ea20a4fc5ed0874340cb47addb398d94703b Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 6 Mar 2025 13:04:40 -0800 Subject: [PATCH] upgrades: Perform easier checks first during dist upgrade Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/upgrades/distupgrade.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plinth/modules/upgrades/distupgrade.py b/plinth/modules/upgrades/distupgrade.py index 3a5e5cb6f..1a59b63ca 100644 --- a/plinth/modules/upgrades/distupgrade.py +++ b/plinth/modules/upgrades/distupgrade.py @@ -93,6 +93,12 @@ def check(test_upgrade=False): Return (boolean, string) indicating if the upgrade is ready, and a reason if not. """ + if not utils.check_auto(): + raise RuntimeError('upgrades-not-enabled') + + if not utils.is_sufficient_free_space(): + raise RuntimeError('not-enough-free-space') + if action_utils.service_is_running('freedombox-dist-upgrade'): raise RuntimeError('found-previous') @@ -108,12 +114,6 @@ def check(test_upgrade=False): if codename == dist: raise RuntimeError(f'already-{dist}') - if not utils.check_auto(): - raise RuntimeError('upgrades-not-enabled') - - if not utils.is_sufficient_free_space(): - raise RuntimeError('not-enough-free-space') - _sources_list_update(dist, codename)