From c76269190a65e5d41a47c68933d2dd9ea72b0ee7 Mon Sep 17 00:00:00 2001 From: Jan Stodola Date: Nov 24 2020 14:36:12 +0000 Subject: Fix incomplete configuration of repositories loaded from treeinfo (#1745064) proxy and ssl certificate check need to be passed to the repo object created based on repositories/variants defined in .treeinfo. Resolves: rhbz#1745064 (cherry picked from commit 9f08080322d94f47b5f181e101323f50aa0b41d7) --- diff --git a/pyanaconda/payload/dnf/payload.py b/pyanaconda/payload/dnf/payload.py index db0ad3a..5945f45 100644 --- a/pyanaconda/payload/dnf/payload.py +++ b/pyanaconda/payload/dnf/payload.py @@ -1587,7 +1587,7 @@ class DNFPayload(Payload): base_repo_url = self._get_base_repo_location(install_tree_url) log.debug("releasever from %s is %s", base_repo_url, self._base.conf.releasever) - self._load_treeinfo_repositories(base_repo_url, disabled_treeinfo_repo_names) + self._load_treeinfo_repositories(base_repo_url, disabled_treeinfo_repo_names, data) except configparser.MissingSectionHeaderError as e: log.error("couldn't set releasever from base repo (%s): %s", source_type, e) @@ -1897,13 +1897,14 @@ class DNFPayload(Payload): log.debug("No base repository found in treeinfo file. Using installation tree root.") return install_tree_url - def _load_treeinfo_repositories(self, base_repo_url, repo_names_to_disable): + def _load_treeinfo_repositories(self, base_repo_url, repo_names_to_disable, data): """Load new repositories from treeinfo file. :param base_repo_url: base repository url. This is not saved anywhere when the function is called. It will be add to the existing urls if not None. :param repo_names_to_disable: list of repository names which should be disabled after load :type repo_names_to_disable: [str] + :param data: repo configuration data """ if self._install_tree_metadata: existing_urls = [] @@ -1927,8 +1928,17 @@ class DNFPayload(Payload): else: repo_enabled = repo_treeinfo.type in enabled_repositories_from_treeinfo - repo = RepoData(name=repo_md.name, baseurl=repo_md.path, - install=False, enabled=repo_enabled) + repo = RepoData( + name=repo_md.name, + baseurl=repo_md.path, + noverifyssl=not data.ssl_verification_enabled, + proxy=data.proxy, + sslcacert=data.ssl_configuration.ca_cert_path, + sslclientcert=data.ssl_configuration.client_cert_path, + sslclientkey=data.ssl_configuration.client_key_path, + install=False, + enabled=repo_enabled + ) repo.treeinfo_origin = True log.debug("Adding new treeinfo repository: %s enabled: %s", repo_md.name, repo_enabled)