[master 1/1] Fix possible to start installation without network (#1221109)

jkonecny12 installerbot-noreply at redhat.com
Wed Jul 15 11:37:05 UTC 2015


From: Jiri Konecny <jkonecny at redhat.com>

Payload manager is started from network spoke if network settings change.
This will start source spoke and software spoke reach-ability testing.

Resolves: rhbz#1221109
---
 pyanaconda/ui/gui/spokes/network.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 74e5aa8..d2b5e1a 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -52,6 +52,7 @@
 from pyanaconda.ui.gui.utils import gtk_call_once, escape_markup
 from pyanaconda.ui.common import FirstbootSpokeMixIn
 from pyanaconda.iutil import startProgram
+from pyanaconda.packaging import payloadMgr
 
 from pyanaconda import network
 from pyanaconda import nm
@@ -1418,12 +1419,19 @@ def __init__(self, *args, **kwargs):
                                          self.on_nm_state_changed)
         self.network_control_box.connect("device-state-changed",
                                          self.on_device_state_changed)
+        # true if network settings change (hostname excluded)
+        self._network_change = False
 
     def apply(self):
         _update_network_data(self.data, self.network_control_box)
         log.debug("network: apply ksdata %s", self.data.network)
         self.network_control_box.kill_nmce(msg="leaving network spoke")
 
+        # if installation media is not used try if source is reachable
+        if self.data.method.method != "cdrom" and self._network_change:
+            payloadMgr.restartThread(self.storage, self.data, self.payload, self.instclass,
+                    checkmount=False)
+
     def execute(self):
         # update system's hostname
         network.set_hostname(self.data.network.hostname)
@@ -1460,16 +1468,19 @@ def initialize(self):
     def refresh(self):
         NormalSpoke.refresh(self)
         self.network_control_box.refresh()
+        self._network_change = False
 
     def on_nm_state_changed(self, *args):
         gtk_call_once(self._update_status)
         gtk_call_once(self._update_hostname)
+        self._network_change = True
 
     def on_device_state_changed(self, source, device, new_state, *args):
         if new_state in (NetworkManager.DeviceState.ACTIVATED,
                          NetworkManager.DeviceState.DISCONNECTED,
                          NetworkManager.DeviceState.UNAVAILABLE):
             gtk_call_once(self._update_status)
+        self._network_change = True
 
     def _update_status(self):
         hubQ.send_message(self.__class__.__name__, self.status)


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


More information about the anaconda-patches mailing list