From 11e86cf8f8467d2774737362eecf3e8a415d2237 Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Sat, 9 Feb 2019 13:39:59 -0500 Subject: [PATCH] radicale: Log errors during upgrade Avoid raising errors which could cause endless loop of setup process failing. Signed-off-by: James Valleroy Reviewed-by: Sunil Mohan Adapa --- plinth/modules/radicale/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plinth/modules/radicale/__init__.py b/plinth/modules/radicale/__init__.py index c5f267507..8d26e9771 100644 --- a/plinth/modules/radicale/__init__.py +++ b/plinth/modules/radicale/__init__.py @@ -18,6 +18,7 @@ FreedomBox app for radicale. """ +import logging import subprocess from distutils.version import LooseVersion as LV @@ -60,6 +61,8 @@ reserved_usernames = ['radicale'] manual_page = 'Radicale' +logger = logging.getLogger(__name__) + CONFIG_FILE = '/etc/radicale/config' VERSION_2 = LV('2') @@ -90,7 +93,7 @@ def setup(helper, old_version=None): cache = Cache() candidate = cache['radicale'].candidate if candidate < '2': - raise RuntimeError('Radicale 2.x is not available to install.') + logger.error('Radicale 2.x is not available to install.') # Try to upgrade radicale 1.x to 2.x. helper.call('pre', actions.superuser_run, 'radicale', ['migrate']) @@ -99,10 +102,9 @@ def setup(helper, old_version=None): # Check that radicale 2.x is installed. current_version = get_package_version() if not current_version: - raise RuntimeError( - 'Could not determine installed version of radicale.') + logger.error('Could not determine installed version of radicale.') elif current_version < VERSION_2: - raise RuntimeError('Could not install radicale 2.x.') + logger.error('Could not install radicale 2.x.') # Enable radicale. helper.call('post', actions.superuser_run, 'radicale', ['setup'])