From a1f7c79b6ba9bb7b60cbc651d408a15c44ef2b82 Mon Sep 17 00:00:00 2001 From: Shubham Ganar Date: Tue, 10 Dec 2024 17:09:57 +0530 Subject: [PATCH] Configure proxy support for create_custom_repos function Signed-off-by: Shubham Ganar --- robottelo/hosts.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/robottelo/hosts.py b/robottelo/hosts.py index 6e8a07e81a..77dcc852b7 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -551,7 +551,7 @@ def create_custom_repos(self, **kwargs): For example:: - create_custom_repo(custom_repo='http://repourl.domain.com/path') + create_custom_repo(custom_repo='http://repourl.domain.com/path', proxy='http://proxy.domain.com:1234') Will create a repository file named ``custom_repo.repo`` with the following contents:: @@ -561,10 +561,14 @@ def create_custom_repos(self, **kwargs): baseurl=http://repourl.domain.com/path enabled=1 gpgcheck=0 + proxy=http://proxy.domain.com:1234 """ for name, url in kwargs.items(): - content = f'[{name}]\n' f'name={name}\n' f'baseurl={url}\n' 'enabled=1\n' 'gpgcheck=0' + content = f'[{name}]\n' f'name={name}\n' f'baseurl={url}\n' 'enabled=1\n' 'gpgcheck=0\n' + # Add proxy configuration for IPv6 + if settings.server.is_ipv6: + content += f'proxy={settings.http_proxy.http_proxy_ipv6_url}' self.execute(f'echo "{content}" > /etc/yum.repos.d/{name}.repo') def get_base_url_for_older_rhel_minor(self):