[rhel7] If the network is disabled, also disable the network part of the source spoke.

David Shea dshea at redhat.com
Tue Jun 9 13:36:59 UTC 2015


From: Chris Lumens <clumens at redhat.com>

Otherwise, the user could be put into a confusing situation where they have
a network source entered, but the displayed error messages do not help the user
figure out that there's no network connection.  For RHEL this is especially bad
since no network is the default.

(cherry picked from commit 822f9348ca2193f700a55e5763fd89bbc06af80a)

Related: rhbz#1196721
---
 pyanaconda/ui/gui/spokes/source.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 67e968c..16c23ae 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -45,6 +45,7 @@ from pyanaconda.threads import threadMgr, AnacondaThread
 from pyanaconda.packaging import PackagePayload, payloadMgr
 from pyanaconda.regexes import REPO_NAME_VALID, URL_PARSE, HOSTNAME_PATTERN_WITHOUT_ANCHORS
 from pyanaconda import constants
+from pyanaconda import nm
 
 from blivet.util import get_mount_paths
 
@@ -773,6 +774,9 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler):
         self._updateURLEntryCheck()
 
         # Set up the default state of UI elements.
+        self._networkButton.set_sensitive(True)
+        self._networkBox.set_sensitive(True)
+
         if self.data.method.method == "url":
             self._networkButton.set_active(True)
 
@@ -846,6 +850,13 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler):
         active = not self._mirror_active() or not self.payload.isRepoEnabled("updates")
         self._noUpdatesCheckbox.set_active(active)
 
+        if not nm.nm_is_connected():
+            self._networkButton.set_sensitive(False)
+            self._networkBox.set_sensitive(False)
+
+            self.clear_info()
+            self.set_warning(_("You need to configure the network to use a network installation source."))
+
     @property
     def showable(self):
         return isinstance(self.payload, PackagePayload)
@@ -1012,6 +1023,7 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler):
         elif not GUISpokeInputCheckHandler.on_back_clicked(self, button):
             return
 
+        self.clear_info()
         NormalSpoke.on_back_clicked(self, button)
 
     def on_chooser_clicked(self, button):
-- 
2.4.2



More information about the anaconda-patches mailing list