From f9dfc02fbf8358c179e27ac2540b7a5cde57077a Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 31 Jul 2014 17:10:19 -0400 Subject: [PATCH] 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 611cef1823c43fb5320f79c796ea5e77eb14681f) Resolves: rhbz#1292680 --- src/sbin/lorax | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sbin/lorax b/src/sbin/lorax index 1e087079..543cae20 100755 --- a/src/sbin/lorax +++ b/src/sbin/lorax @@ -229,10 +229,10 @@ def get_yum_base_object(installroot, repositories, mirrorlists=[], tempdir="/var/tmp", proxy=None, excludepkgs=[]): def sanitize_repo(repo): + """Convert bare paths to file:/// URIs, and silently reject protocols unhandled by yum""" if repo.startswith("/"): return "file://{0}".format(repo) - elif (repo.startswith("http://") or repo.startswith("ftp://") - or repo.startswith("file://")): + elif any(repo.startswith(p) for p in ('http://', 'https://', 'ftp://', 'file://')): return repo else: return None