mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
* add test of yum with proxy * Properly handle unauthenticated yum proxy config Fixes #51548 * shell executable is bash
This commit is contained in:
@@ -703,7 +703,6 @@ class YumModule(YumDnf):
|
||||
# setting system proxy environment and saving old, if exists
|
||||
my = self.yum_base()
|
||||
namepass = ""
|
||||
proxy_url = ""
|
||||
scheme = ["http", "https"]
|
||||
old_proxy_env = [os.getenv("http_proxy"), os.getenv("https_proxy")]
|
||||
try:
|
||||
@@ -726,10 +725,7 @@ class YumModule(YumDnf):
|
||||
)
|
||||
else:
|
||||
for item in scheme:
|
||||
os.environ[item + "_proxy"] = re.sub(
|
||||
r"(http://)",
|
||||
r"\g<1>", proxy_url
|
||||
)
|
||||
os.environ[item + "_proxy"] = my.conf.proxy
|
||||
yield
|
||||
except yum.Errors.YumBaseError:
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user