mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
firewalld: Implement upgrading from 0.4.x to 0.6.x
- firewalld is always on an active. Running setup is not a problem. - Installing new configuration and applying changes on top is more reliable. Changes to be done are not configuration settings but FreedomBox defaults. Fixes: #1367. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
ebca76b236
commit
2f0bc29239
@ -26,7 +26,7 @@ import plinth.service as service_module
|
||||
from plinth import actions, cfg
|
||||
from plinth.menu import main_menu
|
||||
from plinth.signals import service_enabled
|
||||
from plinth.utils import format_lazy
|
||||
from plinth.utils import Version, format_lazy
|
||||
|
||||
from .manifest import backup
|
||||
|
||||
@ -65,6 +65,21 @@ def setup(helper, old_version=None):
|
||||
_run(['setup'], superuser=True)
|
||||
|
||||
|
||||
def force_upgrade(helper, packages):
|
||||
"""Force upgrade firewalld to resolve conffile prompts."""
|
||||
if 'firewalld' not in packages:
|
||||
return
|
||||
|
||||
# firewalld 0.4.4.6-2 -> 0.6.x
|
||||
package = packages['firewalld']
|
||||
if Version(package['current_version']) >= Version('0.6') or \
|
||||
Version(package['new_version']) < Version('0.6'):
|
||||
return
|
||||
|
||||
helper.install(['firewalld'], force_configuration='new')
|
||||
_run(['setup'], superuser=True)
|
||||
|
||||
|
||||
def get_enabled_status():
|
||||
"""Return whether firewall is enabled"""
|
||||
output = _run(['get-status'], superuser=True)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user