[PATCH 2/2 rhel7-branch] network: WPA Enterprise: don't ask twice for password (#1120374)

Radek Vykydal rvykydal at redhat.com
Fri Sep 12 07:38:01 UTC 2014

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):
                     # 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)
         if not uuid:
             log.debug("network: on_edit_connection: can't find connection for device %s", devname)
@@ -564,8 +565,9 @@ class NetworkControlBox(GObject.GObject):
             if self._running_nmce and self._running_nmce.pid == pid:
                 self._running_nmce = None
             if activate:
-                uuid, devname = activate
-                gtk_call_once(self._activate_connection_cb, uuid, devname)
+                uuid, devname, activate_condition = activate
+                if activate_condition():
+                    gtk_call_once(self._activate_connection_cb, uuid, devname)
             network.logIfcfgFiles("nm-c-e run")
     def _activate_connection_cb(self, uuid, devname):

More information about the anaconda-patches mailing list