From: Radek Vykydal <rvykydal(a)redhat.com>
---
pyanaconda/ui/gui/spokes/network.py | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index cf21d6c..2b84e60 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -510,17 +510,25 @@ def on_wireless_ap_changed_cb(self, combobox, *args):
else:
if self._ap_is_enterprise(ap):
# Create a connection for the ap and [Configure] it later with nm-c-e
- values = []
- values.append(['connection', 'uuid', str(uuid4()),
's'])
- values.append(['connection', 'id', ssid_target,
's'])
- values.append(['connection', 'type',
'802-11-wireless', 's'])
- values.append(['802-11-wireless', 'ssid', ssid_bytes,
'ay'])
- values.append(['802-11-wireless', 'mode',
'infrastructure', 's'])
+ con = NM.SimpleConnection.new()
+ s_con = NM.SettingConnection.new()
+ s_con.set_property('uuid', str(uuid4()))
+ s_con.set_property('id', ssid_target)
+ s_con.set_property('type', '802-11-wireless')
+ s_wireless = NM.SettingWireless.new()
+ s_wireless.set_property('ssid', ap.get_ssid())
+ s_wireless.set_property('mode', 'infrastructure')
log.debug("network: adding connection for WPA-Enterprise AP
%s", ssid_target)
- nm.nm_add_connection(values)
+ con.add_setting(s_con)
+ con.add_setting(s_wireless)
+ persistent = True
+ self.client.add_connection_async(con, persistent, None,
self.added_con_cb)
self.builder.get_object("button_wireless_options").set_sensitive(True)
else:
- self.client.add_and_activate_connection_async(None, device,
ap.get_path(), None, None)
+ self.client.add_and_activate_connection_async(None, device,
ap.get_path(), None, self.added_con_cb)
+
+ def added_con_cb(self, client, result):
+ con = client.add_connection_finish(result)
def on_connection_added(self, client, connection):
self.add_connection_to_list(connection.get_uuid())
--
To view this commit on github, visit
https://github.com/rhinstaller/anaconda/commit/0a0941066c0e5c5f6824302322...