MCPcopy Create free account
hub / github.com/ForgeRock/forgeops / check_component_version

Function check_component_version

lib/python/forgeops_dependencies.py:29–41  ·  view source on GitHub ↗

Check if the given component is within the accepted version range. component: name of the component to verify. e.a. kustomize, etc. version: version string to verify. If the version is out of range, an error is raised program terminates.

(component, version)

Source from the content-addressed store, hash-verified

27
28
29def check_component_version(component, version):
30 """
31 Check if the given component is within the accepted version range.
32 component: name of the component to verify. e.a. kustomize, etc.
33 version: version string to verify. If the version is out of range, an error is raised program terminates.
34 """
35 version = __parse_version(version)
36 version_max = __parse_version(REQ_VERSIONS[component]['MAX'])
37 version_min = __parse_version(REQ_VERSIONS[component]['MIN'])
38 if not version_min <= version <= version_max:
39 error(f'Unsupported {component} version found: "{version}".')
40 message(f'Need {component} versions between {version_min} and {version_max}.')
41 sys.exit(1)
42
43
44def check_base_toolset():

Callers 2

check_base_toolsetFunction · 0.85
forgeops_dependenciesFunction · 0.85

Calls 3

errorFunction · 0.90
messageFunction · 0.90
__parse_versionFunction · 0.85

Tested by

no test coverage detected