https is a sane package source URL scheme (#1292680)
Add https as a URL source and use list comprehension to check the
supported protocols.
(cherry picked from commit 611cef1823
)
Resolves: rhbz#1292680
This commit is contained in:
parent
7949b7dc52
commit
f9dfc02fbf
@ -229,10 +229,10 @@ def get_yum_base_object(installroot, repositories, mirrorlists=[],
|
|||||||
tempdir="/var/tmp", proxy=None, excludepkgs=[]):
|
tempdir="/var/tmp", proxy=None, excludepkgs=[]):
|
||||||
|
|
||||||
def sanitize_repo(repo):
|
def sanitize_repo(repo):
|
||||||
|
"""Convert bare paths to file:/// URIs, and silently reject protocols unhandled by yum"""
|
||||||
if repo.startswith("/"):
|
if repo.startswith("/"):
|
||||||
return "file://{0}".format(repo)
|
return "file://{0}".format(repo)
|
||||||
elif (repo.startswith("http://") or repo.startswith("ftp://")
|
elif any(repo.startswith(p) for p in ('http://', 'https://', 'ftp://', 'file://')):
|
||||||
or repo.startswith("file://")):
|
|
||||||
return repo
|
return repo
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user