Skip to content

Commit

Permalink
changed version checker, so that minimum orion version is part of def…
Browse files Browse the repository at this point in the history
…ault settings #190
  • Loading branch information
jkriwet committed Jul 19, 2023
1 parent 02f30c9 commit 9420677
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions filip/clients/ngsi_v2/cb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}."
)


Expand Down
1 change: 1 addition & 0 deletions filip/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 9420677

Please sign in to comment.