Skip to content

Commit

Permalink
changing version_gpg_keys to json file as per PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KrishVora2912 committed Jul 31, 2024
1 parent ab4a0bf commit a82c1fc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 36 deletions.
13 changes: 12 additions & 1 deletion docker/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,26 @@
import tempfile
import os
from distutils.dir_util import copy_tree
from version_gpg_keys import version_gpg_keys
import json
import shutil
import sys
import re

def load_version_gpg_keys():
'''
Loads the version-specific GPG keys from the 'version_gpg_keys.json' file.
'''
script_dir = os.path.dirname(os.path.abspath(__file__))
json_file = os.path.join(script_dir, 'version_gpg_keys.json')
with open(json_file, 'r') as f:
version_gpg_keys = json.load(f)
return version_gpg_keys

def get_gpg_key(kafka_version):
"""
Retrieves the GPG key for the specified kafka version, if it exists, from docker/version_gpg_keys.py.
"""
version_gpg_keys = load_version_gpg_keys()
gpg_key = version_gpg_keys.get(kafka_version)
if gpg_key is not None:
return gpg_key
Expand Down
5 changes: 5 additions & 0 deletions docker/version_gpg_keys.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"3.7.0": "7C38C2F6E7DF40E527C7C996DE0D9D12FB1360DA",
"3.7.1": "4687E2BC1319B57B321D6F0E39AB5531A7FCB08E",
"3.8.0": "CF9500821E9557AEB04E026C05EEA67F87749E61"
}
35 changes: 0 additions & 35 deletions docker/version_gpg_keys.py

This file was deleted.

0 comments on commit a82c1fc

Please sign in to comment.