From 0a9c4bc6a7e6188c4dd3ffde229b35b342b5fb6c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 7 May 2026 15:37:02 -0400 Subject: [PATCH] Block more OSes on profile check --- confluent_server/confluent/osimage.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/osimage.py b/confluent_server/confluent/osimage.py index 571381ab..2c3e0587 100644 --- a/confluent_server/confluent/osimage.py +++ b/confluent_server/confluent/osimage.py @@ -641,6 +641,9 @@ def check_sles(isoinfo): elif '.2' in medianame: disk = '2' if disk and distro: + category = 'suse{0}'.format(major) + if not os.path.exists('/opt/confluent/lib/osdeploy/{0}'.format(category)): + return None return {'name': '{0}-{1}-{2}'.format(distro, ver, arch), 'method': EXTRACT, 'subname': disk, 'category': 'suse{0}'.format(major)} @@ -790,7 +793,11 @@ def check_rhel(isoinfo): 'method': EXTRACT, 'category': cat} return None major = ver.split('.', 1)[0] - return {'name': 'rhel-{0}-{1}'.format(ver, arch), 'method': EXTRACT, 'category': 'el{0}'.format(major)} + category = 'el{0}'.format(major) + defprofile = '/opt/confluent/lib/osdeploy/{0}'.format(category) + if not os.path.exists(defprofile): + return None + return {'name': 'rhel-{0}-{1}'.format(ver, arch), 'method': EXTRACT, 'category': category} def fingerprint_initramfs(archive): curroffset = archive.tell()