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

jkonecny12 installerbot-noreply at redhat.com
Fri Jul 17 13:02:33 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 | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 74e5aa8..2a4c356 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,21 @@ 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 or hdd is not used try if source is reachable
+        if (self.data.method.method != "cdrom"
+            and self.data.method.method != "harddrive"
+            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 +1470,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/4a061273f39c26cc2863e51913b786a85ca0ea25


More information about the anaconda-patches mailing list