Skip to content

Commit

Permalink
Fix possible to start installation without network (#1221109)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jkonecny12 committed Jul 17, 2015
1 parent a29b759 commit d239863
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pyanaconda/ui/gui/spokes/network.py
Expand Up @@ -1418,12 +1418,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):
from pyanaconda.packaging import payloadMgr
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)
Expand Down Expand Up @@ -1460,16 +1469,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)
Expand Down

0 comments on commit d239863

Please sign in to comment.