[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH master] Use method from isys for wireless devs checking (#473803)



Also pack the checking method in Network object.
---
 gui.py     |    3 +--
 network.py |   15 ++++++---------
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/gui.py b/gui.py
index efb510c..696dcd9 100755
--- a/gui.py
+++ b/gui.py
@@ -982,8 +982,7 @@ class InstallInterface(InstallInterfaceBase):
                 self.anaconda.network.updateActiveDevices([install_device])
 
             # we might want to do this only once
-            # TODORV: put into Network objects
-            if network.hasWirelessDev():
+            if self.anaconda.network.hasWirelessDev():
                 # NOTE: For wireless, we need supplicant to go to ready state,
                 #       that means to get the wireless device managed by NM
                 self.anaconda.network.writeIfcfgFiles()
diff --git a/network.py b/network.py
index a535a54..8553281 100644
--- a/network.py
+++ b/network.py
@@ -163,15 +163,6 @@ def hasActiveNetDev():
     except:
         return False
 
-def hasWirelessDev():
-    devprops = isys.getDeviceProperties()
-    for dev, props in devprops.items():
-        device_type = int(props.Get(isys.NM_DEVICE_IFACE, "DeviceType"))
-        if device_type == 2:
-            return True
-    return False
-
-
 # Return a list of device names (e.g., eth0) for all active devices.
 # Returning a list here even though we will almost always have one
 # device.  NM uses lists throughout its D-Bus communication, so trying
@@ -558,6 +549,12 @@ class Network:
 
         return False
 
+    def hasWirelessDev(self):
+        for dev in self.netdevices:
+            if isys.isWirelessDevice(dev)
+                return True
+        return False
+
     def _copyFileToPath(self, file, instPath='', overwrite=False):
         if not os.path.isfile(file):
             return False
-- 
1.6.0.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]