From 4395484ff4f9db6f4f171166dd2006494a80adae Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Sun, 4 Sep 2022 07:36:39 -0400 Subject: [PATCH] firewall: Allow upgrade from any version to 1.2.* Closes: #2253 Tests: - Build a package with this fix included for bullseye-backports distribution. - Install into FreedomBox stable system. - Start dist-upgrade test. - At the end of the test, wait for plinth to attempt upgrades, and then confirm that firewalld was upgraded. - Confirm that firewalld is running. - Confirm that /etc/firewalld/firewalld.conf has DefaultZone=external. Signed-off-by: James Valleroy Reviewed-by: Sunil Mohan Adapa --- plinth/modules/firewall/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plinth/modules/firewall/__init__.py b/plinth/modules/firewall/__init__.py index e4ddae2fb..8b4dc11f2 100644 --- a/plinth/modules/firewall/__init__.py +++ b/plinth/modules/firewall/__init__.py @@ -86,11 +86,9 @@ class FirewallApp(app_module.App): if 'firewalld' not in packages: return False - # firewalld 0.6.x -> 0.7.x, 0.6.x -> 0.8.x, 0.7.x -> 0.8.x, 0.9.x -> - # 1.0.x + # Allow upgrade from any version to 1.2.* package = packages['firewalld'] - if Version(package['current_version']) >= Version('1.0') or \ - Version(package['new_version']) < Version('0.7'): + if Version(package['new_version']) > Version('1.3~'): return False install(['firewalld'], force_configuration='new')