[PATCH rhel7-branch/master] If the network is disabled, also disable the network part of the source spoke.
Martin Kolman
mkolman at redhat.com
Fri Sep 26 09:42:34 UTC 2014
On Thu, 2014-09-25 at 16:24 -0400, Chris Lumens wrote:
> 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.
>
> Resolves: rhbz#1072453
> ---
> pyanaconda/ui/gui/spokes/source.py | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
> index 7a72785..812f01f 100644
> --- a/pyanaconda/ui/gui/spokes/source.py
> +++ b/pyanaconda/ui/gui/spokes/source.py
> @@ -42,6 +42,7 @@ from pyanaconda.ui.gui.utils import gtk_call_once, really_hide, really_show
> from pyanaconda.threads import threadMgr, AnacondaThread
> from pyanaconda.packaging import PackagePayload, payloadMgr
> from pyanaconda import constants
> +from pyanaconda import nm
>
> from blivet.util import get_mount_device, get_mount_paths
>
> @@ -761,6 +762,18 @@ class SourceSpoke(NormalSpoke):
> # that condition here too.
> self.on_protocol_changed(self._protocolComboBox)
>
> + # If there's no network up (which is the default case), disable all the
> + # network-related stuff.
> + 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."))
> + else:
> + self._networkButton.set_sensitive(True)
> + self._networkBox.set_sensitive(True)
> +
> @property
> def showable(self):
> return isinstance(self.payload, PackagePayload)
> @@ -806,6 +819,10 @@ class SourceSpoke(NormalSpoke):
> if len(ui_repo_names) != len(frozenset(ui_repo_names)):
> return
> else:
> + # Clear any error message on the bottom of the screen so that on
> + # the next visit to this spoke, the user doesn't see a stale message
> + # about no network being up.
> + self.clear_info()
> NormalSpoke.on_back_clicked(self, button)
>
> def on_chooser_clicked(self, button):
ACK and thanks! :)
More information about the anaconda-patches
mailing list