Skip to content

Commit

Permalink
WIP: fix repofile.py - the /etc/apt/trusted.gpg.d dir may not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernhard committed Aug 2, 2024
1 parent 085b20e commit a15dad4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/rhsm/repofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,17 @@ def fix_content(self, content):

# 'Signed-By': look for pulp public-key in '/etc/apt/trusted.gpg.d/'
keypath = "/etc/apt/trusted.gpg.d/"
keyfiles = [
os.path.join(keypath, f)
for f in os.listdir(keypath)
if os.path.isfile(os.path.join(keypath, f))
and (f.startswith("orcharhino_") or f.startswith("pulp_") or f.startswith("client"))
and (f.endswith(".gpg") or f.endswith(".asc"))
]
if os.path.exists(keypath) and os.path.isdir(keypath):
keyfiles = [
os.path.join(keypath, f)
for f in os.listdir(keypath)
if os.path.isfile(os.path.join(keypath, f))
and (f.startswith("orcharhino_") or f.startswith("pulp_") or f.startswith("client"))
and (f.endswith(".gpg") or f.endswith(".asc"))
]
else:
keyfiles = []

orcharhino_keyfile = None
if len(keyfiles) > 1:
orcharhino_keyfile = keyfiles[0]
Expand Down

0 comments on commit a15dad4

Please sign in to comment.