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 authored and Sunil Mohan Adapa committed 2020-12-13 15:51:38 -08:00
1 parent dd6a03442e
commit 863b3cdfe0
1 file changed
+16
+16
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()