On Fri, 2014-09-12 at 09:38 +0200, Radek Vykydal wrote:
When configuring ([Configure], using nm-c-e) wireless connection for AP we want to activate it automatically after configuration (leaving nm-c-e). But we don't want to do it if:
(A) the connection has been active before configuration, or (B) the connection was activated automatically after saving the configuration (as is usual case for WPA Enterprise AP configuration)
We used to check if there is an active connection for the AP before configuration (running nm-c-e), but to catch also case (B) (and prevent asking for password for second time), move the check to *after* configuration (after leaving nm-c-e and possibly saving the configuration)
Related: rhbz#1120374
pyanaconda/ui/gui/spokes/network.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py index 3025708..92c1747 100644 --- a/pyanaconda/ui/gui/spokes/network.py +++ b/pyanaconda/ui/gui/spokes/network.py @@ -534,8 +534,9 @@ class NetworkControlBox(GObject.GObject): else: # 871132 auto activate wireless connection after editing if it is not # already activated (assume entering secrets)
if self.selected_ssid != nm.nm_device_active_ssid(devname):
activate = (uuid, devname)
def condition():
return self.selected_ssid != nm.nm_device_active_ssid(devname)
activate = (uuid, devname, condition)
I think you can use 'condition = lambda:...' instead of 'def condition' or just pass the lambda directly.
Otherwise both these patches look good to me.