From 94206774b73ae4307d3f46e882f23cc7ff020d5f Mon Sep 17 00:00:00 2001 From: jkriwet Date: Wed, 19 Jul 2023 16:43:44 +0200 Subject: [PATCH] changed version checker, so that minimum orion version is part of default settings #190 --- filip/clients/ngsi_v2/cb.py | 10 ++++------ filip/config.py | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/filip/clients/ngsi_v2/cb.py b/filip/clients/ngsi_v2/cb.py index 44b09890..1c642a69 100644 --- a/filip/clients/ngsi_v2/cb.py +++ b/filip/clients/ngsi_v2/cb.py @@ -166,13 +166,11 @@ def _check_correct_cb_version(self) -> None: option, which is implemented in FiLiP, but won't work with lower orion versions. """ orion_version = self.get_version()['orion']['version'] - if version.parse(orion_version) < version.parse('3.6.0'): + if version.parse(orion_version) < version.parse(settings.minimum_orion_version): warnings.warn( - f"You are using orion version {orion_version}. There was a breaking change in Orion Version 3.6.0," - f"which changed the default metadata update semantics and introduced the 'overrideMetadata' option. " - f"See https://github.com/telefonicaid/fiware-orion/releases/tag/3.6.0 for further details. " - f"In your used version {orion_version}, this option is not supported. This will only be a problem, if" - f" you try to set the 'overrideMetadata' option in FiLiP (implemented since v0.2.3)." + f"You are using orion version {orion_version}. There was a breaking change in Orion Version " + f"{settings.minimum_orion_version}, therefore functionality is not assured when using " + f"version {orion_version}." ) diff --git a/filip/config.py b/filip/config.py index db072518..8a129b92 100644 --- a/filip/config.py +++ b/filip/config.py @@ -21,6 +21,7 @@ class Settings(BaseSettings): QL_URL: AnyHttpUrl = Field(default="http://127.0.0.1:8668", env=['QUANTUMLEAP_URL', 'QL_URL']) + minimum_orion_version: str = '3.6.0' class Config: env_file = '.env.filip' env_file_encoding = 'utf-8'