]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Remove extras dependency with a partial oslo sync.
authorSteve Baker <sbaker@redhat.com>
Tue, 15 Jan 2013 19:58:47 +0000 (08:58 +1300)
committerSteve Baker <sbaker@redhat.com>
Tue, 15 Jan 2013 19:58:47 +0000 (08:58 +1300)
Only service.py and importutils.py have been synchronized.

This change is a blocker for producing g-2 rpms

Change-Id: I692a8f6c9948a7aa75a2f6db7657d6c72e09a772

docs/GettingStarted.rst
heat/openstack/common/importutils.py
heat/openstack/common/service.py
tools/pip-requires

index 61314849b6b8ab702a61841ba07c1218186867a9..faab1fdd5637eb727e22b71c9b81960b947ed6c0 100644 (file)
@@ -94,14 +94,6 @@ In the heat directory, run the install script::
 
     sudo ./install.sh
 
-Install heat pip dependency
----------------------------
-
-Heat requires the extras module, which is not currently packaged for Fedora, so it is necessary to manually install it::
-
-    sudo yum install -y python-pip
-    sudo pip-python install extras
-
 Download Fedora 17 DVD and copy it to libvirt images location
 -------------------------------------------------------------
 
index 2a28b455e85c811abc3a509e0d3f9775a815cff4..9dec764fb4097bf5860c562a514baec88571fe79 100644 (file)
@@ -57,3 +57,11 @@ def import_module(import_str):
     """Import a module."""
     __import__(import_str)
     return sys.modules[import_str]
+
+
+def try_import(import_str, default=None):
+    """Try to import a module and if it fails return default."""
+    try:
+        return import_module(import_str)
+    except ImportError:
+        return default
index 8b63785f27d43233253e5ebf9bb2e28041d2b6d1..4b3ef90119dc099b60a8d617a6c9548674eb4191 100644 (file)
@@ -27,17 +27,17 @@ import sys
 import time
 
 import eventlet
-import extras
 import logging as std_logging
 
 from heat.openstack.common import cfg
 from heat.openstack.common import eventlet_backdoor
 from heat.openstack.common.gettextutils import _
+from heat.openstack.common import importutils
 from heat.openstack.common import log as logging
 from heat.openstack.common import threadgroup
 
 
-rpc = extras.try_import('heat.openstack.common.rpc')
+rpc = importutils.try_import('heat.openstack.common.rpc')
 CONF = cfg.CONF
 LOG = logging.getLogger(__name__)
 
@@ -243,7 +243,10 @@ class ProcessLauncher(object):
 
     def _wait_child(self):
         try:
-            pid, status = os.wait()
+            # Don't block if no child processes have exited
+            pid, status = os.waitpid(0, os.WNOHANG)
+            if not pid:
+                return None
         except OSError as exc:
             if exc.errno not in (errno.EINTR, errno.ECHILD):
                 raise
@@ -275,6 +278,10 @@ class ProcessLauncher(object):
         while self.running:
             wrap = self._wait_child()
             if not wrap:
+                # Yield to other threads if no children have exited
+                # Sleep for a short time to avoid excessive CPU usage
+                # (see bug #1095346)
+                eventlet.greenthread.sleep(.01)
                 continue
 
             while self.running and len(wrap.children) < wrap.workers:
index 213b1e6fa4aadebce976f8f79fb6208f495fb7e5..76498c4ebccc4cbc10462fbee84361ec300388b2 100644 (file)
@@ -12,7 +12,6 @@
 PyCrypto>=2.1.0
 boto>=2.4.0
 eventlet>=0.9.17
-extras
 greenlet>=0.3.1
 httplib2
 iso8601>=0.1.4