[master 16/20] libnm in spoke: to check if device is activated just use its object

rvykydal installerbot-noreply at redhat.com
Mon Aug 31 14:55:59 UTC 2015


From: Radek Vykydal <rvykydal at redhat.com>

---
 pyanaconda/ui/gui/spokes/network.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index cd765ba..a308ff0 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -523,7 +523,6 @@ def on_edit_connection(self, *args):
         if not dev_cfg:
             return
 
-        devname = dev_cfg.get_iface()
         device = dev_cfg.device
         con = dev_cfg.con
         activate = None
@@ -546,7 +545,7 @@ def on_edit_connection(self, *args):
                 log.debug("network: on_edit_connection: connection for device %s not found", dev_cfg.get_iface())
                 return
 
-            if devname in nm.nm_activated_devices():
+            if device and device.get_state() == NM.DeviceState.ACTIVATED:
                 # Reactivate the connection after configuring it (if it changed)
                 settings = con.to_dbus(NM.ConnectionSerializationFlags.ALL)
                 settings_changed = lambda: settings != con.to_dbus(NM.ConnectionSerializationFlags.ALL)


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/899331ec81384aecf49e41d8eef5142452757c8d


More information about the anaconda-patches mailing list