From: Radek Vykydal <rvykydal(a)redhat.com>
---
pyanaconda/ui/gui/spokes/network.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index c761425..3b238fb 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -508,7 +508,17 @@ def on_connection_added(self, client, connection):
self.add_connection_to_list(connection)
def on_device_added(self, client, device, *args):
- gtk_call_once(self.add_device_to_list, device)
+ # We need to wait for valid state before adding the device to our list
+ if device.get_state() == NM.DeviceState.UNKNOWN:
+ device.connect("state-changed",
self.on_added_device_state_changed)
+ else:
+ gtk_call_once(self.add_device_to_list, device)
+
+ def on_added_device_state_changed(self, device, new_state, *args):
+ # We need to wait for valid state before adding the device to our list
+ if new_state != NM.DeviceState.UNKNOWN:
+ device.disconnect_by_func(self.on_added_device_state_changed)
+ gtk_call_once(self.add_device_to_list, device)
def on_device_removed(self, client, device, *args):
self.remove_device(device)
--
To view this commit on github, visit
https://github.com/rhinstaller/anaconda/commit/9b1a6654a1d791d1e4c0ef89cc...