diff --git a/src/subscription_manager/repofile.py b/src/subscription_manager/repofile.py index 854d9c1d53..223a7c9cd5 100644 --- a/src/subscription_manager/repofile.py +++ b/src/subscription_manager/repofile.py @@ -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.*)$", baseurl) ent_res = re.match(r"^/etc/pki/entitlement/(?P.*).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: