From 7ebc623d824bb5543754c25017dac6b40d5175af Mon Sep 17 00:00:00 2001 From: gursewak1997 Date: Mon, 29 Jul 2024 13:09:53 -0700 Subject: [PATCH] Allow .dev as tag_stream for fcos version For testing-devel, we have older builds with .dev(non-int) as tag_stream. Lets allow that to pass as a valid FCOS version through parse_fcos_version_to_timestamp_and_stream --- src/cmd-container-prune | 2 +- src/cosalib/cmdlib.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd-container-prune b/src/cmd-container-prune index 67bdfb00cd..4d2e3d4acf 100755 --- a/src/cmd-container-prune +++ b/src/cmd-container-prune @@ -102,7 +102,7 @@ def main(): except Exception: print(f"WARNING: Ignoring unexpected tag: {tag}") continue - if stream_id != tag_stream: + if stream_id != int(tag_stream): if args.v: print(f"Skipping tag {tag} not in {args.stream} stream") continue diff --git a/src/cosalib/cmdlib.py b/src/cosalib/cmdlib.py index 6e44e53ccc..f25f567fb1 100644 --- a/src/cosalib/cmdlib.py +++ b/src/cosalib/cmdlib.py @@ -351,7 +351,7 @@ def parse_fcos_version_to_timestamp_and_stream(version): timestamp = datetime.datetime.strptime(m.group(2), '%Y%m%d') except ValueError: raise Exception(f"FCOS build {version} has incorrect date format. It should be in (%Y%m%d)") - return (timestamp, int(m.group(3))) + return (timestamp, m.group(3)) def convert_duration_to_days(duration_arg):