mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix the logic around whether or not a version is available
This commit is contained in:
parent
3b3b9fbc49
commit
398056dafb
1 changed files with 7 additions and 7 deletions
14
tools/ci.py
14
tools/ci.py
|
@ -843,12 +843,12 @@ def pkg_matrix(
|
|||
key_filter = (
|
||||
f"Contents[?contains(Key, '{version}')] | [?ends_with(Key, '.exe')]"
|
||||
)
|
||||
# objects = list(page_iterator.search(f"Contents[?contains(Key, '{key_filter}')][]"))
|
||||
objects = page_iterator.search(key_filter)
|
||||
# ctx.info(objects)
|
||||
try:
|
||||
first = next(objects)
|
||||
ctx.info(f"Found {version} ({backend}) for {distro_slug}: {first['Key']}")
|
||||
objects = list(page_iterator.search(key_filter))
|
||||
# Testing using `any` because sometimes the paginator returns `[None]`
|
||||
if any(objects):
|
||||
ctx.info(
|
||||
f"Found {version} ({backend}) for {distro_slug}: {objects[0]['Key']}"
|
||||
)
|
||||
for session in ("upgrade", "downgrade"):
|
||||
matrix.append(
|
||||
{
|
||||
|
@ -858,7 +858,7 @@ def pkg_matrix(
|
|||
"version": str(version),
|
||||
}
|
||||
)
|
||||
except StopIteration:
|
||||
else:
|
||||
ctx.info(f"No {version} ({backend}) for {distro_slug} at {prefix}")
|
||||
|
||||
ctx.info("Generated matrix:")
|
||||
|
|
Loading…
Add table
Reference in a new issue