cmd-list: handle missing builds gracefully
If we do `cosa buildfetch`, we're only fetching details for the latest
build. But `cosa list` wants to show all the builds in `builds.json`,
which is a massive list for e.g. `testing-devel`. Just have it stop once
it hits a missing build.
@@ -20,8 +20,13 @@ def main():
tags[tag['target']] = tags.get(tag['target'], []) + [tag['name']]
for build in builds.get_builds():
- print(f"{build['id']}")
+ try:
m = builds.get_build_meta(build['id'])
+ except FileNotFoundError:
+ print("<missing builds locally>")
+ break
+
+ print(f"{build['id']}")
ts = m['coreos-assembler.build-timestamp']
d = parse_date_string(ts)
delta = datetime.datetime.now(datetime.timezone.utc) - d
