From ea491f8f4d147f45355fbee02491e8ed08bb0742 Mon Sep 17 00:00:00 2001 From: Sylvain Leclerc Date: Fri, 22 Nov 2024 15:18:46 +0100 Subject: [PATCH] fix(update): installation from versions older than 2.18 is not supported Signed-off-by: Sylvain Leclerc --- src/antares_web_installer/app.py | 4 ++++ tests/integration/server_mock/server.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/antares_web_installer/app.py b/src/antares_web_installer/app.py index 4a78e35..87dd050 100644 --- a/src/antares_web_installer/app.py +++ b/src/antares_web_installer/app.py @@ -147,6 +147,10 @@ def install_files(self): # check app version old_version = self.check_version() logger.info(f"Old application version : {old_version}.") + version_info = tuple(map(int, old_version.split("."))) + if version_info < (2, 18): + raise InstallError( + f"Trying to update from version ${old_version}: updating from version older than 2.18 is not supported, please select a new installation directory.") self.update_progress(25) # update config file diff --git a/tests/integration/server_mock/server.py b/tests/integration/server_mock/server.py index 8683b59..21775d9 100644 --- a/tests/integration/server_mock/server.py +++ b/tests/integration/server_mock/server.py @@ -13,7 +13,7 @@ # Define the server configuration HOST = "127.0.0.1" PORT = 8080 -VERSION = "2.14.4" +VERSION = "2.18.0" def main():