Skip to content

Commit

Permalink
[zap] Fix version check
Browse files Browse the repository at this point in the history
zap_execution.py would fail when the minimum version was
2023.1.9 and installed was 2023.1.17.

Signed-off-by: Damian Krolik <[email protected]>
  • Loading branch information
Damian-Nordic committed Jan 18, 2023
1 parent 1edcf88 commit 1cdd356
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/tools/zap/zap_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
import sys
from typing import Tuple

# The version MUST be of the form `YYYY.MM.YY'
# Since this is ordered as such, alphabetical sorting will be used to check
# validity
# The version MUST be of the form `YYYY.M.D'
#
# Use scripts/tools/zap/version_update.py to manage ZAP versioning as many
# files may need updating for versions
Expand Down Expand Up @@ -97,7 +95,10 @@ def version_check(self, min_version=None):
print('*'*80)
sys.exit(1)

if version < MIN_ZAP_VERSION:
def parse_version_string(str):
return list(map(lambda component: int(component), str.split('.')))

if parse_version_string(version) < parse_version_string(MIN_ZAP_VERSION):
print(f"Checking ZAP from {self.zap_start}:")
print(
f" !!! Version validation failed: required at least {MIN_ZAP_VERSION}, got {version} instead")
Expand Down

0 comments on commit 1cdd356

Please sign in to comment.