setup: Ensure that apt is updated before checking force upgrade

If the package cache is outdated and a check is performed for whether force
upgrade is needed, it might return negative. After the operation proceeds to run
setup, we perform 'apt update' before 'apt install' at this point the
configuration file prompt will cause failure.

Tests:

- Re-run firewalld upgrade from 1.3.x to 2.1.x with a re-run setup.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2024-02-15 19:47:51 -05:00
1 parent e208bdbbca
commit bd4ddcf158
1 file changed
+1
+1
View File
@@ -62,6 +62,7 @@ def _run_setup_on_app(app, current_version):
# Check if this app needs force_upgrade. If it is needed, but not
# yet supported for the new version of the package, then an
# exception will be raised, so that we do not run setup.
package.refresh_package_lists()
force_upgrader = ForceUpgrader.get_instance()
force_upgrader.attempt_upgrade_for_app(app.app_id)