fedora-image-tester: don't assume the compose ID is a date
GA and RC composes aren't formatted as a date. Pull the value from the metadata instead, and fall back to the current time if that fails. Signed-off-by: Jeremy Cline <jeremycline@microsoft.com>
This commit is contained in:
parent
1c95e2b032
commit
f28d44e62b
1 changed files with 9 additions and 5 deletions
|
|
@ -62,9 +62,9 @@ class Consumer:
|
|||
ack the message while we process it.
|
||||
"""
|
||||
# Short-term hack you should revert: our Azure account is low on funds, so only
|
||||
# test F44 images until it's sorted out.
|
||||
if message.body["release"] != 44:
|
||||
_log.info("Skipping non-F44 image as a cost saving measure")
|
||||
# test F44 and F45 images until it's sorted out.
|
||||
if message.body["release"] < 44:
|
||||
_log.info("Skipping old images and ELN")
|
||||
return
|
||||
|
||||
try:
|
||||
|
|
@ -455,8 +455,12 @@ class TestRunner:
|
|||
if release == "eln":
|
||||
release = release.upper()
|
||||
|
||||
# Format date from YYYYMMDD to YYYY-MM-DD
|
||||
formatted_date = datetime.fromisoformat(ffrel.compose).strftime("%Y-%m-%d")
|
||||
try:
|
||||
compose_date = ffrel.metadata['composeinfo']['payload']['compose']['date']
|
||||
formatted_date = datetime.fromisoformat(compose_date).strftime("%Y-%m-%d")
|
||||
except KeyError:
|
||||
_log.error("Compose metadata didn't have a date!")
|
||||
formatted_date = datetime.datetime.now(datetime.UTC).strftime("%Y-%m-%d")
|
||||
|
||||
return {
|
||||
"version": release,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue