[f22-branch 1/1] Configure proxy settings for dnf payload (#1211122)

bcl installerbot-noreply at redhat.com
Thu Apr 23 23:45:41 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

---
 pyanaconda/packaging/dnfpayload.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
index 2f127a0..7e7d262 100644
--- a/pyanaconda/packaging/dnfpayload.py
+++ b/pyanaconda/packaging/dnfpayload.py
@@ -369,6 +369,19 @@ def _configure(self):
         # transaction, disable it in RPM:
         conf.tsflags.append('nocrypto')
 
+        if hasattr(self.data.method, "proxy") and self.data.method.proxy:
+            try:
+                proxy = ProxyString(self.data.method.proxy)
+                conf.proxy = proxy.noauth_url
+                if proxy.username:
+                    conf.proxy_username = proxy.username
+                if proxy.password:
+                    conf.proxy_password = proxy.password
+                log.info("Using %s as proxy", self.data.method.proxy)
+            except ProxyStringError as e:
+                log.error("Failed to parse proxy for dnf configure %s: %s",
+                          self.data.method.proxy, e)
+
         # Start with an empty comps so we can go ahead and use the environment
         # and group properties. Unset reposdir to ensure dnf has nothing it can
         # check automatically


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/1855924d0a3335cf2fc0bc44b18b830615704d4e


More information about the anaconda-patches mailing list