[PATCH] re-fetch metadata when proxy settings change

Brian C. Lane bcl at redhat.com
Tue Feb 12 21:58:04 UTC 2013


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

If you entered a bad proxy the only way to get it to continue was to
change the source to something different.
---
 pyanaconda/ui/gui/spokes/source.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 87ebb89..b5a7162 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -95,8 +95,6 @@ class ProxyDialog(GUIObject):
         self._proxyAuthBox.set_sensitive(button.get_active())
 
     def refresh(self):
-        import re
-
         GUIObject.refresh(self)
 
         self._proxyCheck = self.builder.get_object("enableProxyCheck")
@@ -435,6 +433,7 @@ class SourceSpoke(NormalSpoke):
         self._currentIsoFile = None
         self._ready = False
         self._error = False
+        self._proxyChange = False
 
     def apply(self):
         import copy
@@ -475,7 +474,8 @@ class SourceSpoke(NormalSpoke):
         elif self._mirror_active():
             # this preserves the url for later editing
             self.data.method.method = None
-            if not old_source.method and self.payload.baseRepo:
+            if not old_source.method and self.payload.baseRepo and \
+               not self._proxyChange:
                 return
         elif self._http_active() or self._ftp_active():
             url = self._urlEntry.get_text().strip()
@@ -499,7 +499,7 @@ class SourceSpoke(NormalSpoke):
                 url = "https://" + url
                 mirrorlist = self._mirrorlistCheckbox.get_active()
 
-            if old_source.method == "url" and \
+            if old_source.method == "url" and not self._proxyChange and \
                ((not mirrorlist and old_source.url == url) or \
                 (mirrorlist and old_source.mirrorlist == url)):
                 return
@@ -879,10 +879,12 @@ class SourceSpoke(NormalSpoke):
                 self._verifyIsoButton.set_sensitive(True)
 
     def on_proxy_clicked(self, button):
+        old_proxy = self.data.method.proxy
         dialog = ProxyDialog(self.data)
         with enlightbox(self.window, dialog.window):
             dialog.refresh()
             dialog.run()
+        self._proxyChange = old_proxy != self.data.method.proxy
 
     def on_verify_iso_clicked(self, button):
         p = self._get_selected_partition()
-- 
1.8.1



More information about the anaconda-patches mailing list