Skip to content

Commit

Permalink
fixup! fixup! Handle URL params for AptRepoFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
quba42 committed Oct 18, 2024
1 parent c06c4b5 commit 6cf5ca0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/subscription_manager/repofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,12 +463,11 @@ def fix_content(self, content):
# Luckily apt ignores all Fields it does not recognize
parsed_url = urlparse(unquote(content["baseurl"]))
baseurl = parsed_url._replace(query="").geturl()
url_res = re.match(r"^https?://(?P<location>.*)$", baseurl)
ent_res = re.match(r"^/etc/pki/entitlement/(?P<entitlement>.*).pem$", content["sslclientcert"])
if url_res and ent_res:
location = url_res.group("location")
if parsed_url.scheme in ['http', 'https'] and ent_res:
entitlement = ent_res.group("entitlement")
baseurl = "katello://{}@{}".format(entitlement, location)
netloc = entitlement + '@' + parsed_url.netloc
baseurl = parsed_url._replace(query="",scheme="katello",netloc=netloc).geturl()

query = parse_qs(parsed_url.query)
if "rel" in query and "comp" in query:
Expand Down

0 comments on commit 6cf5ca0

Please sign in to comment.