2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-11-21 09:52:24 +00:00

Query the release package in the image, not the host

Without the rpm Python bindings, fingerprinting an image found its
system-release provider in the image database but then ran rpm -qi
against the host, so an image whose release package the host lacks was
not recognized. Use the same rooted rpm command for both queries.
This commit is contained in:
Markus Hilger
2026-11-01 16:59:52 +01:00
parent af8d91a507
commit 8b4445e675
+1 -1
View File
@@ -1529,7 +1529,7 @@ def fingerprint_host_el(args, hostpath='/'):
rver = subprocess.check_output(rpmcmd + ['-q', '--whatprovides', 'system-release'])
if not isinstance(rver, str):
rver = rver.decode('utf8')
for infline in subprocess.check_output('rpm -qi {0}'.format(rver).split()).decode('utf8').split('\n'):
for infline in subprocess.check_output(rpmcmd + ['-qi', rver.strip()]).decode('utf8').split('\n'):
if ':' not in infline:
continue
k, v = infline.split(':', 1)