From bfa8ef6c41ceab7067b91e077609dd944403917d Mon Sep 17 00:00:00 2001 From: gursewak1997 Date: Thu, 25 Jul 2024 01:05:05 -0700 Subject: [PATCH] Minor fixes: Fix fcos version check and error return 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. --- src/cmd-cloud-prune | 2 +- src/cosalib/cmdlib.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd-cloud-prune b/src/cmd-cloud-prune index 2db5efba7a..28be5255e8 100755 --- a/src/cmd-cloud-prune +++ b/src/cmd-cloud-prune @@ -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") diff --git a/src/cosalib/cmdlib.py b/src/cosalib/cmdlib.py index 12e9056cd4..6e44e53ccc 100644 --- a/src/cosalib/cmdlib.py +++ b/src/cosalib/cmdlib.py @@ -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: