From 7d49c5f9be51027fdaf441f15d7f424330cdf05f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 11 Jun 2025 15:48:53 -0400 Subject: [PATCH] Do not error out on listing profiles/distributions before any exist --- confluent_server/confluent/osimage.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/osimage.py b/confluent_server/confluent/osimage.py index f3d174c1..75a64e77 100644 --- a/confluent_server/confluent/osimage.py +++ b/confluent_server/confluent/osimage.py @@ -31,6 +31,7 @@ READFILES = set([ '.DISCINFO', '.discinfo', 'zipl.prm', + 'sources/idwbinfo.txt', ]) HEADERSUMS = set([b'\x85\xeddW\x86\xc5\xbdhx\xbe\x81\x18X\x1e\xb4O\x14\x9d\x11\xb7C8\x9b\x97R\x0c-\xb8Ht\xcb\xb3']) @@ -774,10 +775,16 @@ def printit(info): def list_distros(): - return sorted(os.listdir('/var/lib/confluent/distributions')) + try: + return sorted(os.listdir('/var/lib/confluent/distributions')) + except FileNotFoundError: + return [] def list_profiles(): - return sorted(os.listdir('/var/lib/confluent/public/os/')) + try: + return sorted(os.listdir('/var/lib/confluent/public/os/')) + except FileNotFoundError: + return [] def get_profile_label(profile): with open('/var/lib/confluent/public/os/{0}/profile.yaml') as metadata: