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 <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2022-09-04 07:36:39 -04:00 committed by Sunil Mohan Adapa
parent 4920e33160
commit 4395484ff4
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -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')