2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-10-23 15:35:35 +00:00

Try to add gpgkey to local repository

This is needed for things like followup imgutil
This commit is contained in:
Jarrod Johnson
2025-04-09 13:27:29 -04:00
parent 9744e0d1b0
commit 2e60ca13b7

View File

@@ -6,6 +6,7 @@ except ImportError:
import importlib.util
import importlib.machinery
import sys
import glob
modloader = importlib.machinery.SourceFileLoader('apiclient', '/opt/confluent/bin/apiclient')
modspec = importlib.util.spec_from_file_location('apiclient', '/opt/confluent/bin/apiclient', loader=modloader)
apiclient = importlib.util.module_from_spec(modspec)
@@ -41,6 +42,7 @@ try:
except AttributeError:
f = cStringIO.StringIO(cfgdata)
c.readfp(f)
gpgkeys = glob.glob('/etc/pki/rpm-gpg/RPM-GG-KEY-*')
for sec in c.sections():
if sec.startswith('variant-'):
try:
@@ -56,3 +58,5 @@ for sec in c.sections():
repopath = repopath[1:]
repout.write('baseurl=https://{}/confluent-public/os/{}/distribution/{}\n'.format(server, profile, repopath))
repout.write('enabled=1\n')
if gpgkeys:
repout.write('gpgkey=file://' + gpgkeys[0] + '\n')