mumble: Implement force upgrade for 1.3.*

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2020-12-02 19:35:42 -05:00 committed by Sunil Mohan Adapa
parent dd6a03442e
commit 863b3cdfe0
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -16,6 +16,7 @@ from plinth.modules import names
from plinth.modules.firewall.components import Firewall
from plinth.modules.letsencrypt.components import LetsEncrypt
from plinth.modules.users.components import UsersAndGroups
from plinth.utils import Version
from .manifest import backup, clients # noqa, pylint: disable=unused-import
@ -98,6 +99,21 @@ def setup(helper, old_version=None):
app.get_component('letsencrypt-mumble').setup_certificates()
def force_upgrade(helper, packages):
"""Force upgrade mumble-server to resolve conffile prompts."""
if 'mumble-server' not in packages:
return False
# Allow upgrades within 1.3.*
package = packages['mumble-server']
if Version(package['new_version']) > Version('1.4~'):
return False
helper.install(['mumble-server'], force_configuration='new')
helper.call('post', actions.superuser_run, 'mumble', ['setup'])
return True
def get_available_domains():
"""Return an iterator with all domains able to have a certificate."""
return (domain.name for domain in names.components.DomainName.list()