[PATCH 2/2] Use the new wait for connectivity function

Martin Kolman mkolman at redhat.com
Tue Jul 9 15:36:38 UTC 2013


Signed-off-by: Martin Kolman <mkolman at redhat.com>
---
 pyanaconda/geoloc.py | 15 ++-------------
 pyanaconda/vnc.py    |  2 +-
 2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/pyanaconda/geoloc.py b/pyanaconda/geoloc.py
index 5a6da14..46dc6f2 100644
--- a/pyanaconda/geoloc.py
+++ b/pyanaconda/geoloc.py
@@ -107,13 +107,13 @@ import dbus
 import threading
 import time
 import timezone
+import network
 
 import logging
 log = logging.getLogger("anaconda")
 
 from pyanaconda import constants
 from pyanaconda.threads import AnacondaThread, threadMgr
-from pyanaconda import nm
 
 location_info_instance = None
 
@@ -270,7 +270,7 @@ class LocationInfo(object):
         if threadMgr.get(constants.THREAD_GEOLOCATION_REFRESH):
             log.debug("Geoloc: refresh already in progress")
         else:  # wait for Internet connectivity
-            if self._wait_for_connectivity():
+            if network.wait_for_connectivity():
                 threadMgr.add(AnacondaThread(
                     name=constants.THREAD_GEOLOCATION_REFRESH,
                     target=self._provider.refresh))
@@ -278,17 +278,6 @@ class LocationInfo(object):
                 log.error("Geolocation refresh failed"
                           " - no connectivity")
 
-    def _wait_for_connectivity(self):
-        """ Wait for Internet connectivity to become available.
-
-        :return: True is connectivity is available, False otherwise
-        :rtype: bool
-        """
-        # wait for the thread that waits for NM to connect
-        threadMgr.wait(constants.THREAD_WAIT_FOR_CONNECTING_NM)
-        # then check if NM connected successfully
-        return nm.nm_is_connected()
-
     def get_result(self):
         """Get result from the provider
 
diff --git a/pyanaconda/vnc.py b/pyanaconda/vnc.py
index 71d9344..be76f46 100644
--- a/pyanaconda/vnc.py
+++ b/pyanaconda/vnc.py
@@ -193,7 +193,7 @@ class VncServer:
 
     def startServer(self):
         self.log.info(_("Starting VNC..."))
-        network.wait_for_connecting_NM()
+        network.wait_for_connectivity()
 
         # Lets call it from here for now.
         try:
-- 
1.8.3.1



More information about the anaconda-patches mailing list