Skip to content

Commit

Permalink
Minor fixes: Fix fcos version check and error return
Browse files Browse the repository at this point in the history
We have few older builds for testing-devel which had .dev
in their buildIDs. Fixed the version check to accept that.
Also fixed the return statement in delete_gcp_image to return
empty errors list instead on returning None as needed.
  • Loading branch information
gursewak1997 committed Jul 29, 2024
1 parent 6cf62cb commit bfa8ef6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cmd-cloud-prune
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def delete_gcp_image(build, cloud_config, dry_run):
gcp = build.images.get("gcp")
if not gcp:
print(f"No GCP image for {build.id} for {build.arch}")
return
return errors
gcp_image = gcp.get("image")
json_key = cloud_config.get("gcp", {}).get("json-key")
project = cloud_config.get("gcp", {}).get("project")
Expand Down
2 changes: 1 addition & 1 deletion src/cosalib/cmdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def parse_fcos_version_to_timestamp_and_stream(version):
Parses an FCOS build ID and verifies the versioning is accurate. Then
it verifies that the parsed timestamp has %Y%m%d format and returns that.
'''
m = re.match(r'^([0-9]{2})\.([0-9]{8})\.([0-9]+)\.([0-9]+)$', version)
m = re.match(r'^([0-9]{2})\.([0-9]{8})\.([0-9]+|dev)\.([0-9]+)$', version)
if m is None:
raise Exception(f"Incorrect versioning for FCOS build {version}")
try:
Expand Down

0 comments on commit bfa8ef6

Please sign in to comment.