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
-------------------------------------------------------------
"""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
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__)
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
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: